cache-domains/scripts
Travis Snoozy 31b2ba1e0a
Tell dnsmasq not to pass requests upstream (#223)
* 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>
2023-03-28 11:36:46 +01:00
..
config.example.json Added bare IP example in config.example.json 2022-08-18 19:38:56 +07:00
create-adguardhome.sh added AdGuard Home scripts 2022-07-19 19:23:56 +07:00
create-dnsmasq.sh Tell dnsmasq not to pass requests upstream (#223) 2023-03-28 11:36:46 +01:00
create-rpz.sh Script Support for RPZ Domains (#180) 2022-04-03 15:53:00 +01:00
create-squid.sh Added some commentry to create-squid.sh 2021-10-10 12:44:18 +00:00
create-unbound.sh Remove duplicates in Unbound generation script 2021-06-15 13:14:49 +10:00
README.md added AdGuard Home scripts 2022-07-19 19:23:56 +07:00

DNS Generation Scripts

Introduction

The respective shell scripts contained within this directory can be utilised to generate application specific compliant configuration which can be utilised with:

  • Dnsmasq
  • Unbound
  • AdGuard Home

Usage

  1. Copy config.example.json to config.json.
  2. Modify config.json to include your Cacheserver's IP(s) and the CDNs you plan to cache. The following example assumes a single shared Cacheserver IP:
{
  "ips": {
    "generic":	["10.10.10.200"]
  },
  "cache_domains": {
    "blizzard":     "generic",
    "epicgames":    "generic",
    "nintendo":     "generic",
    "origin":       "generic",
    "riot":         "generic",
    "sony":         "generic",
    "steam":        "generic",
    "uplay":        "generic",
    "wsus":         "generic"
  }
}
  1. Run generation script relative to your DNS implementation: bash create-dnsmasq.sh.
  2. Copy files from output/{dnsmasq,unbound}/* to the respective locations for Dnsmasq/Unbound.
  3. Restart Dnsmasq or Unbound.

Notes for Dnsmasq users

This also applies to users utilising the script alongside Pi-hole.

Multi-IP Lancache setups are only supported with Dnsmasq or Pi-hole versions >= 2.86 or 2021.09 respectively.

Notes for AdGuard Home users

  1. In the config.json, you may want to add an entry for your non-cached DNS upstreams. You can input this in ip.adguardhome_upstream as an array.
  2. Once you have ran the script, you can point the upstream list to the text file generated. For example: upstream_dns_file: "/root/cache-domains/scripts/output/adguardhome/cache-domains.txt"