Opscraft
Name servers & SOA · Lesson 4 of 8 · 3 min read

Primary, secondary and zone transfers

Replication between authoritative servers

Traditional DNS (BIND-style) has one primary (formerly "master") where the zone is edited, and secondaries ("slaves") that hold read-only copies. All are equally authoritative to clients; having several on different networks provides redundancy.

Zone transfers

  • AXFR — full zone transfer (every record).
  • IXFR — incremental transfer (only changes since a serial).
  • Both run over TCP port 53 (zone data is large).
  • NOTIFY — the primary tells secondaries "the zone changed" immediately, so they don't wait for REFRESH.

Flow: edit zone on primary → bump serial → primary sends NOTIFY → secondary queries SOA, sees a higher serial → requests IXFR/AXFR → serves the new data.

Enlarge diagramPrimarywhere you editSecondaryread-only copyedit zone, bump serial2026102501 → 2026102502NOTIFY: the zone changedSOA? (what is your serial?)2026102502: higher than mineIXFR from 2026102501 (TCP 53)just the changed records
Figure 1. Classic primary/secondary replication: the primary sends NOTIFY, the secondary compares serials and pulls the changes over TCP 53.
Swipe sideways to see all of it, or tap to open it full screen.

Securing transfers

An open AXFR lets anyone download your whole zone — a map of internal hostnames for an attacker. Restrict transfers:

  • allow-transfer { 192.0.2.53; 198.51.100.53; }; (BIND) — only your secondaries' IPs.
  • TSIG — shared-secret signatures on transfer requests and responses.
dig AXFR example.com @ns1.example.com     # should be REFUSED from random hosts

A hidden primary setup keeps the editable primary off the public NS list; only secondaries (often a managed provider) answer the internet.

Route 53 and multi-provider DNS

Route 53 doesn't support outbound AXFR (you can't make another provider a secondary via zone transfer) or act as a classic secondary. For multi-provider authoritative DNS (resilience against a provider-wide outage), teams:

  • manage records as code (Terraform with two providers, octoDNS, DNSControl) and push identical data to both providers;
  • list name servers from both providers at the registrar;
  • keep TTLs and feature use compatible (Route 53-only features like alias records and routing policies don't translate — use CNAMEs/plain records for multi-provider names).
Enlarge diagramDNS as codeoctoDNS,DNSControl,TerraformRoute 534 name serverssecond provider4 name serversregistrarlists all 8 name servers
Figure 2. Running two DNS providers for resilience: no zone transfers out of Route 53, so push the same records to both from code and list both sets of name servers.
Swipe sideways to see all of it, or tap to open it full screen.