This commit is contained in:
Mateusz Gruszczyński committed 2026-11-22 14:21:54 +01:00
commit fa432bebda
189 files changed
+26219

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
# Hybrid
One process can be Primary for some zones, Secondary for others, forward private domains
and recurse for everything else:
```yaml
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`)
1. **Local authoritative zones** – the most specific zone visible in the client's view wins
(`example.com` beats a forward rule for `com`); NXDOMAIN inside a local zone is final and
the name is never sent upstream.
2. **Recursion permission** – clients outside `recursion.allowed_clients` get REFUSED.
3. **Local-only names** (`localhost`, `local`, `test`, `invalid`, `home.arpa`, `onion`,
RFC 1918/6303 reverse zones, plus `recursion.local_only_suffixes`) → NXDOMAIN locally.
A forward rule for such a name takes precedence (e.g. forwarding `home.arpa` to a router).
4. **Allow/block policy.**
5. **Conditional forwarding** – longest matching suffix (and client ACL).
6. **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.