1.7 KiB
1.7 KiB
Hybrid
One process can be Primary for some zones, Secondary for others, forward private domains and recurse for everything else:
recursion: { enabled: true, allowed_clients: ["acl:lan"] }
zones:
- { name: example.com, type: primary, file: zones/example.com.zone }
- { name: example.net, type: secondary, primaries: ["192.0.2.10:53"] }
forward_zones:
- { domain: corp.internal, upstreams: ["10.0.0.53"] }
resolution:
default: recursive
views:
- { name: lan, clients: ["10.0.0.0/8"] }
- { name: world, clients: [any] }
Precedence (tested in crates/dns-server/tests/resolver.rs)
- Local authoritative zones – the most specific zone visible in the client's view wins
(
example.combeats a forward rule forcom); NXDOMAIN inside a local zone is final and the name is never sent upstream. - Recursion permission – clients outside
recursion.allowed_clientsget REFUSED. - Local-only names (
localhost,local,test,invalid,home.arpa,onion, RFC 1918/6303 reverse zones, plusrecursion.local_only_suffixes) → NXDOMAIN locally. A forward rule for such a name takes precedence (e.g. forwardinghome.arpato a router). - Allow/block policy.
- Conditional forwarding – longest matching suffix (and client ACL).
- Default resolution.
Data spaces are separate: authoritative zones are never cached; each forwarding rule and the recursive resolver use their own cache namespace.
Views (split horizon)
zones[].views: [lan] makes a zone visible only to clients of that view; the same zone
name can be defined twice with different files for different views. Views are matched in
order; the first match wins.