* Tell dnsmasq not to pass requests upstream
The behavior of dnsmasq changed in version 2.86 -- before then, if a record was set for a domain name with dnsmasq, and a record for a type not specified for that domain was requested, dnsmasq would indicate no data existed for that record type. After 2.86, record types that are not specified are instead passed upstream. The latter behavior causes problems for, e.g., the Steam client, which will disregard a correctly set A-record for lancache.steamcontent.com, if no AAAA is set with dnsmasq and dnsmasq passes the AAAA query upstream. The documentation for dnsmasq indicates the correct way to restore the old behavior is to use the local=/host/ syntax -- emit this syntax for each of our lancache-hosted DNS entries.
* Update scripts/create-dnsmasq.sh
Co-authored-by: Amir Zarrinkafsh <nightah@me.com>
---------
Co-authored-by: Amir Zarrinkafsh <nightah@me.com>
* add script to generate bind response policy zone for dns manipulation/filtering
* rpz: support custom basedomain via cli arg
* Update create-rpz.sh
* changed times to match current lanacache_dns
[Dnsmasq version >= 2.86](https://thekelleys.org.uk/dnsmasq/CHANGELOG) supports passing multiple IP addresses via the `address=` syntax now.
>Major rewrite of the DNS server and domain handling code. The change makes multiple addresses associated with a domain work address=/example.com/1.2.3.4 address=/example.com/5.6.7.8.
This allows us to simplify the script and the `.hosts` file workaround is no longer necessary.
#149 introduced a minor regression which included duplicates for the Unbound generation script.
While this does not have a technical impact it may cause confusion for users, this PR will ignore duplicate entries.
This change leverages #130 and also applies this to the dnsmasq script.
As it currently stands both generation scripts (unbound and dnsmasq) have a condition where a domain will be skipped if it fuzzy matches a domain already parsed that is higher in the CDN domain list.
For example the latter of the below two samples would never be added.
8793ce1531/steam.txt (L20)8793ce1531/steam.txt (L29)
I've also taken the liberty to sort the output of said scripts for readability and troubleshooting purposes.
Closes#130.
While #140 added support for round-robin DNS the script needs a slight modification to ensure that wildcard domains are still added with the old method due to dnsmasq limitations.
This change will include all wildcard domains in the generated `lancache.conf` along with all the `addn-hosts=` entries.
This change is a continuation of #54, it modifies the output of the dnsmasq script to host file format which allows round robin DNS entries.
There is a caveat with round robin DNS entries in dnsmasq, they only supports a single address for wildcard domains, for example: *.cdn.blizzard.com.
If previously you had the generated .conf files dumped into a directory where dnsmasq automatically loaded on start-up, you will need to create config that loads all the host files, for example:
**lancache.conf**
```conf
addn-hosts=/etc/dnsmasq/conf.d/blizzard.hosts
addn-hosts=/etc/dnsmasq/conf.d/steam.hosts
addn-hosts=/etc/dnsmasq/conf.d/uplay.hosts
```
Closes#107.