Files
EasyDNS/docs/hybrid.md
T
2026-11-23 09:31:05 +01:00

1.9 KiB
Raw Blame History

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/primary/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. Hosts files (hosts.files, only for clients in recursion.allowed_clients) – a name listed there is answered from the files (NODATA for other types); see hosts.md.
  2. 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.
  3. Recursion permission – clients outside recursion.allowed_clients get REFUSED.
  4. 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).
  5. Allow/block policy.
  6. Conditional forwarding – longest matching suffix (and client ACL).
  7. 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.