adblock-dns/config.example.yaml
2026-11-14 14:03:49 +01:00

55 lines
2.2 KiB
YAML

# One file for every site. The ZONE env var (e.g. "home" or "dc1") selects which
# `zones.<name>` section is merged on top of the global settings, and which
# `records` apply. Nothing here requires the sites to reach each other.
upstream:
mode: recursive # or: forward (+ servers: [...])
dnssec: strict # strict | permissive | off
cache:
max_mb: 64
min_ttl: 5s
max_ttl: 24h
stale: 1h # serve-stale window while upstream is down
blocking:
mode: null # null (0.0.0.0/::) | nxdomain | refused | ip
cname_inspect: true # block CNAME-cloaked trackers
lists:
- name: stevenblack
url: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
# - name: hagezi-pro
# url: https://raw.githubusercontent.com/hagezi/dns-blocklists/main/domains/pro.txt
# - name: my-allowlist # entries of an allow list override all block lists
# file: /etc/adblock-dns/allow.txt
# allow: true
# overrides of the lists (precedence: allow > block > list exceptions > lists)
allow: [example-allowed.com]
block: [example-blocked.com]
allow_regex: []
block_regex: ['^ads?[0-9]*\.']
records: # local DNS overrides; wildcard names supported
- {name: router.lan, type: A, value: 192.168.1.1}
- {name: nas.lan, type: A, value: 192.168.1.10, zones: [home]} # same name,
- {name: nas.lan, type: A, value: 10.20.0.10, zones: [dc1]} # per-zone answer
- {name: "*.apps.lan", type: CNAME, value: ingress.lan., zones: [home]}
forward_zones: # split-horizon / conditional forwarding (no DNSSEC)
- {zone: corp.example.com, servers: [10.20.0.53]}
- {zone: ad.example.com, servers: [10.3.9.81]} # same zone twice = both servers
- {zone: ad.example.com, servers: [10.3.9.82]}
- {zone: 10.in-addr.arpa, servers: [10.3.15.9]} # reverse zones work too
zones: # per-zone settings; lists/records/allow/... are appended
home:
upstream: {mode: recursive}
sync:
peers_dns: adblock-dns-headless.dns.svc:8080
dc1:
upstream: {mode: forward, servers: ["10.20.0.2", "10.20.0.3"]}
redis: {addr: redis.dns.svc:6379}
sync:
peers_dns: adblock-dns-headless.dns.svc:8080