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

PrimarySecondary
Where the data comes fromA zone file, a database or an API you editZone transfers from the primary (or from another secondary)
Answers queriesYes, authoritatively, unless it is a hidden primaryYes, authoritatively. Resolvers cannot tell the difference.
Listed in NS recordsUsually, but not requiredUsually. Only listed servers receive public queries.
Sends NOTIFYYes, to every secondaryOnly if other servers transfer from it
When it stops servingNever on its ownAfter the SOA expire time without a successful refresh
Older namesMasterSlave. 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

  1. 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.
  2. 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.
  3. Each secondary asks the primary for its SOA and compares serials using serial number arithmetic (RFC 1982).
  4. 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.
  5. 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 fieldTypical valueWhat a secondary does with it
Refresh1 to 4 hoursHow often to check the primary's serial without a NOTIFY
Retry15 minutes to 1 hourHow soon to try again after a failed check
Expire2 to 4 weeksHow 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

SymptomLikely cause
Some servers show the old record, with an older serialSerial not increased, NOTIFY not sent to that server, or transfers blocked by a firewall or ACL
Changes arrive, but only hours laterNOTIFY is not reaching the secondary, so it waits for the refresh timer
Transfer refused or "NOTAUTH" in logsTSIG key name or secret mismatch, or the secondary's address is not allowed (often its IPv6 address)
"BADTIME" errorsClocks differ by more than the TSIG fudge
A secondary answers SERVFAIL for the whole zoneIt has not reached the primary for longer than the expire time
Signed zone fails validation on secondaries onlyThe signer stopped and the RRSIG records the secondaries hold have expired
Anyone can download the zoneTransfers allowed to any address

Checking primaries and secondaries yourself

CommandWhat you want to see
dig +nssearch example.comThe SOA serial from every listed nameserver. They should all match after a change has settled.
dig +norecurse @ns2.example.net example.com SOAOne 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 secondaryThe full zone, proving the TSIG key and ACL work
rndc notify example.comBIND: send NOTIFY again after fixing a secondary
rndc retransfer example.comBIND, 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