A secondary DNS server pulls updates from a primary. The naive way is to ship the whole zone every time something changes — AXFR. The clever way is to ship only the records that changed since the last transfer — IXFR. This article explains both wire protocols, the SOA serial logic that drives them, when implementations fall back from IXFR to AXFR, and the operational signals worth watching.
How to verify
Two queries tell you what kind of transfers are happening between a pair. The journal files are the source of truth on the secondary:
dig @primary.example.com example.com SOA +short
dig @secondary.example.com example.com SOA +short
sudo named-journalprint /var/cache/bind/db.example.com.jnl | head
sudo journalctl -u named -n 100 --no-pager | grep -E 'AXFR|IXFR'
tshark -i any -f 'port 53 and tcp' -Y 'dns.qry.type == AXFR or dns.qry.type == IXFR'
The journal file (.jnl) on the secondary contains the IXFR deltas. If it does not exist, the secondary cannot do IXFR — it will keep asking for AXFRs.
What’s happening
A zone transfer is a DNS query of a special type, sent over TCP because the response can be much larger than 512 bytes. The primary holds the authoritative copy; the secondary asks for it. There are two query types:
AXFR (Full Zone Transfer, RFC 5936). The query is <zone> AXFR. The response is the entire zone, one record per message, terminated by a copy of the SOA. Simple, slow on large zones, and stateless — the primary does not need to know what the secondary already has.
IXFR (Incremental Zone Transfer, RFC 1995). The query is <zone> IXFR plus the SOA the secondary currently holds. The primary computes the diff between that serial and the current serial, ships only the deltas (delete record / add record pairs), and signals “done” with the current SOA.
The primary computes deltas by reading the journal (db.example.com.jnl in BIND, similar in other implementations). The journal is a log of zone changes recorded between AXFR points. If the secondary asks for a serial too old to be in the journal, or if the journal is missing/corrupt, the primary falls back to AXFR for that request.
The decision tree on every refresh:
- Secondary fetches SOA from primary.
- If secondary’s serial >= primary’s, nothing to do.
- If secondary’s serial < primary’s, send IXFR with current serial.
- Primary checks journal: if it can serve the IXFR, does so. If not, returns full AXFR.
- Secondary applies the deltas (IXFR) or replaces the zone (AXFR).
Decision: when to use which
Always prefer IXFR. It is faster on large zones, uses less bandwidth, and produces smaller secondary-side restart times. Modern authoritative servers default to IXFR, but you can force the behaviour:
- BIND:
request-ixfr yes;(on secondaries) andprovide-ixfr yes;(on primaries). - Knot: IXFR is default.
- PowerDNS:
ixfr=yesin the slave config. - NSD:
request-xfrwithIXFRdefaults to IXFR-then-fallback-to-AXFR.
AXFR is fine for tiny zones. A zone with 50 records re-transferred fully takes milliseconds. The complexity of journal management does not pay off until zones get into the thousands of records.
Force AXFR when the journal is suspect. Two cases:
- Restoring from backup. The secondary’s journal may be stale; force a fresh AXFR with
rndc retransfer example.com. - After algorithm rollover with DNSSEC. The signed RRSIGs change for every record; IXFR sends a huge delta and you save nothing — explicit AXFR is cleaner.
Operational notes
- Watch the journal file size. A long-running secondary accumulates journal entries. BIND auto-rotates with
max-journal-size; Knot has a configurable size; NSD does not use journals the same way. Disk-full caused by journal growth is a real production incident. - Mismatched journal between pair members. If you back up the secondary’s zone file but not the journal, and restore, the SOA in the file says serial N but the journal points at serial N+50 — confusion ensues. Either back up both atomically or run
rndc retransferafter restore. - AXFR storm after primary restart. Some implementations clear the journal on restart, causing every secondary to fall back to AXFR. On a fan-out of 20 secondaries this is a noticeable spike. Stagger with
notify-delayoralso-notifyordering. - NOTIFY without IXFR support. Old secondaries (or non-DNS-aware monitoring tools) might NOTIFY and then AXFR every time. Check secondary logs for
IXFRvsAXFRratios; if AXFR is dominant on a zone where it should not be, something is misconfigured. - DNSSEC and IXFR. A signed zone’s RRSIGs have inception/expiration timestamps that change on re-sign — even if no other records changed. This creates surprisingly large IXFR deltas. It is normal; do not chase it.
For the wider primary/secondary setup, see BIND9 zone transfer for the concrete configuration on BIND, and TSIG keys for the signing layer that authenticates the transfer.
In the engagements we run, transfer pathology is one of the most common DNS-side incidents — a missing journal, a stale TSIG, a wrong firewall rule for TCP/53. We monitor SOA serial parity across the pair, alert on serial divergence longer than the SOA refresh interval, and run a periodic rndc retransfer drill to confirm AXFR fallback still works. See our managed operations service for the broader operating model.