Customise the blocklist
By default, your server downloads the same configuration as the public Bancuh DNS service, straight from GitHub. To change what’s blocked, point it at your own copy instead.
Use your own configuration
Section titled “Use your own configuration”-
Edit the files under
data/in your clone of adblock-dns-server. For quick additions, use the two files that are already wired in:data/blacklist.d/__extra_blacklist.hosts: domains to blockdata/whitelist.d/__extra_whitelist.hosts: domains to allow
-
In
EXAMPLES/default/.env, pointCONFIG_URLat the local file. Thedata/folder is mounted into the container at/local-data/:.env CONFIG_URL=/local-data/configuration.yaml -
Run
./start.sh. The list is rebuilt on start and then once a day.
The configuration file
Section titled “The configuration file”configuration.yaml has three lists. Each entry names a format and a path,
which is either a URL or a path relative to the configuration file.
blacklist: - format: hosts path: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts - format: domains path: https://big.oisd.nl/domainswild - format: hosts path: ./blacklist.d/__extra_blacklist.hosts
whitelist: - format: domains path: ./whitelist.d/misc_whitelist.txt - format: zone path: ./overrides.d/google-safesearch.zone
overrides: - format: cname path: ./overrides.d/google-safesearch.zone| List | What it does | Formats |
|---|---|---|
blacklist |
Domains to block. They answer 0.0.0.0 / ::. |
hosts, domains |
whitelist |
Domains that are never blocked, even if a blacklist has them. | hosts, domains, zone |
overrides |
Domains to answer with a different name (a CNAME). | cname |
Formats
Section titled “Formats”-
hosts: the classic hosts file format. The address is ignored.0.0.0.0 ads.example.com127.0.0.1 tracker.example.net -
domains: one domain per line. Use*.example.comto include subdomains.ads.example.com*.tracker.example.net -
cname(andzonein the whitelist): a domain,CNAME, and the name to answer with.www.bing.com CNAME strict.bing.com.
Lines starting with # are comments.
Common changes
Section titled “Common changes”Turn off SafeSearch. Remove the *-safesearch.zone entries from both
whitelist and overrides. They’re listed in the whitelist too so the
search engines themselves are never blocked.
Allow a category. Remove its sources from blacklist. For example, to
allow VPNs, remove the VPN, proxy and doh-vpn-proxy-bypass lists, and the VPN
section of misc_blacklist.txt.
Block something extra. Add the domain to __extra_blacklist.hosts, or add
a new source URL under blacklist.