Support Library
Primary vs Secondary DNS and Zone Transfers
Most zones are served by more than one authoritative server, and something has to keep them identical. In the classic design one server holds the master copy and the rest copy it by zone transfer. This guide covers how that works, what breaks, and how to check it.
The short answer
The primary is where the zone is edited. Secondaries copy the zone from it by zone transfer and then answer queries with exactly the same authority. The primary sends a NOTIFY when the zone changes; each secondary compares the SOA serial and, if it is higher, pulls the changes by IXFR (incremental) or the whole zone by AXFR. If NOTIFY is lost, secondaries poll on the SOA refresh timer. If they cannot reach the primary for longer than the SOA expire time, they stop answering for the zone.
Primary and secondary compared
| Primary | Secondary | |
|---|---|---|
| Where the data comes from | A zone file, a database or an API you edit | Zone transfers from the primary (or from another secondary) |
| Answers queries | Yes, authoritatively, unless it is a hidden primary | Yes, authoritatively. Resolvers cannot tell the difference. |
| Listed in NS records | Usually, but not required | Usually. Only listed servers receive public queries. |
| Sends NOTIFY | Yes, to every secondary | Only if other servers transfer from it |
| When it stops serving | Never on its own | After the SOA expire time without a successful refresh |
| Older names | Master | Slave. RFC 9499 uses primary and secondary. |
Primary and secondary describe how a server gets the zone, not how important it is. Many managed DNS providers can act as either: they can pull your zone from your own primary ("secondary DNS"), or host the primary and send transfers to another provider. Providers that sync through their own APIs instead of zone transfers are covered in multi-provider DNS strategy.
How a change reaches the secondaries
- The zone is edited on the primary and its SOA serial goes up. Most software does this for you; with hand-edited zone files it is the step most often forgotten.
- The primary sends NOTIFY (RFC 1996) to every server in the zone's NS set except itself, plus any extra servers configured with also-notify or the equivalent.
- Each secondary asks the primary for its SOA and compares serials using serial number arithmetic (RFC 1982).
- If the serial is higher, the secondary requests a transfer. IXFR (RFC 1995) sends only the differences since the secondary's serial; the primary falls back to a full AXFR (RFC 5936) if it does not have that history.
- The secondary loads the new copy and starts answering from it. Transfers run over TCP port 53, or over TLS (XoT, RFC 9103) where both sides support it.
The SOA timers cover the case where NOTIFY never arrives:
| SOA field | Typical value | What a secondary does with it |
|---|---|---|
| Refresh | 1 to 4 hours | How often to check the primary's serial without a NOTIFY |
| Retry | 15 minutes to 1 hour | How soon to try again after a failed check |
| Expire | 2 to 4 weeks | How long to keep serving the last copy with no successful check. After that the secondary answers SERVFAIL. |
See SOA record tuning for choosing these values.
Serial numbers
The serial is a 32-bit number that only has to go up. The common format is the date plus a two-digit counter, such as 2026111001 for the first change on November 10, 2026. Secondaries compare serials with wrap-around arithmetic, so a serial that went down by mistake looks older than the one they have, and they ignore every change until the primary's serial passes theirs again.
To fix a serial that was set too high, step it forward rather than back. Each step must add less than 2,147,483,648 (231), counting past 4,294,967,295 back round to 0. Add up to 2,147,483,647, wait until every secondary has loaded that serial, and repeat until the value you want is less than 231 ahead; then set it, and it counts as "higher" in serial arithmetic. Two steps usually do it; a very large gap can take three. Some providers instead offer a way to force a full transfer. Never lower a serial and hope.
Securing zone transfers
- Allow transfers only to your secondaries. An open AXFR hands the whole zone, including internal-looking names, to anyone who asks. Restrict by address and require a key.
- Use TSIG (RFC 8945), a shared secret that signs each transfer and NOTIFY. Keys are named and must match on both sides, and TSIG checks time, so server clocks need to be in sync (the default allowed difference is 300 seconds).
- Accept NOTIFY only from the primary, ideally also signed with TSIG.
- Consider XoT (zone transfer over TLS) if the zone crosses networks you do not trust and both ends support it.
- Remember the secondaries' addresses in firewall rules for both IPv4 and IPv6, and for TCP as well as UDP.
When transfers go wrong
| Symptom | Likely cause |
|---|---|
| Some servers show the old record, with an older serial | Serial not increased, NOTIFY not sent to that server, or transfers blocked by a firewall or ACL |
| Changes arrive, but only hours later | NOTIFY is not reaching the secondary, so it waits for the refresh timer |
| Transfer refused or "NOTAUTH" in logs | TSIG key name or secret mismatch, or the secondary's address is not allowed (often its IPv6 address) |
| "BADTIME" errors | Clocks differ by more than the TSIG fudge |
| A secondary answers SERVFAIL for the whole zone | It has not reached the primary for longer than the expire time |
| Signed zone fails validation on secondaries only | The signer stopped and the RRSIG records the secondaries hold have expired |
| Anyone can download the zone | Transfers allowed to any address |
Checking primaries and secondaries yourself
| Command | What you want to see |
|---|---|
| dig +nssearch example.com | The SOA serial from every listed nameserver. They should all match after a change has settled. |
| dig +norecurse @ns2.example.net example.com SOA | One server's serial, with the aa flag |
| dig @ns2.example.net example.com AXFR, from outside your network | "Transfer failed" or REFUSED. A full zone in reply means transfers are open. |
| dig -k transfer.key @192.0.2.53 example.com AXFR, from a secondary | The full zone, proving the TSIG key and ACL work |
| rndc notify example.com | BIND: send NOTIFY again after fixing a secondary |
| rndc retransfer example.com | BIND, on a secondary: force a full transfer now |
For ongoing assurance, alert when any server's serial lags the primary's for longer than a few minutes.
How DNS Panopticon helps
Security Posture asks every nameserver in a domain's NS set for the zone and flags servers that do not answer for it (lame delegation), and reads the SOA record. The DNS Propagation Checker asks the authoritative servers for a record next to public resolvers, which shows quickly if one server is still serving an old answer. DNS Panopticon does not attempt zone transfers, so it cannot tell you whether AXFR is open; use the command above for that.
FAQ
Is a secondary DNS server a backup that only answers when the primary is down?
No. Every server listed in the NS records answers queries all the time, and resolvers spread their queries across them. A secondary is a full peer that happens to get its copy of the zone by transfer.
Should the primary be listed in the NS records?
It can be, but it does not have to be. Leaving it out gives a hidden primary design, where only the secondaries face the internet.
What is the difference between AXFR and IXFR?
AXFR sends the whole zone. IXFR sends only the changes since the serial the secondary already has, and falls back to a full transfer when the primary does not have that history.
Why did my change not reach one nameserver?
Check the serial on each server first. A serial that did not go up, a NOTIFY that was not sent to that server, or a transfer blocked by a firewall or key mismatch are the usual causes.
Sources and further reading
- RFC 9499: DNS Terminology (primary, secondary, hidden primary)
- RFC 1996: A Mechanism for Prompt Notification of Zone Changes (NOTIFY)
- RFC 1995: Incremental Zone Transfer in DNS (IXFR)
- RFC 5936: DNS Zone Transfer Protocol (AXFR)
- RFC 1982: Serial Number Arithmetic
- RFC 8945: Secret Key Transaction Authentication for DNS (TSIG)
- RFC 9103: DNS Zone Transfer over TLS
- BIND 9 Administrator Reference Manual