Skip to content
AdminKit

What is a DNS zone transfer (AXFR), and why an open one leaks your whole zone

AXFR (Authoritative Transfer) is the DNS mechanism a secondary name server uses to copy an entire zone from a domain's primary server, designed to run only between a domain's own authorized servers; answering an AXFR request from anyone on the internet instead hands out a complete map of the domain's hostnames. AdminKit explains how to check and fix it.

By AdminKit team, Netbase JSC · Updated

Key takeaways

  • AXFR copies a whole DNS zone from a primary name server to its secondaries. It is routine between your own servers and a leak when a stranger can do it.
  • The check is dig axfr @<each name server> yourdomain, run from outside your network. “Transfer failed.” is the good result; a list of records is the bad one.
  • RFC 5936 tells DNS software to support restricting AXFR and not to default to “open to all”. Restrict by IP address, by TSIG key, or both.
  • TSIG proves who is asking but does not encrypt the transfer. XFR over TLS (RFC 9103) adds confidentiality.

What is AXFR designed to do?

Every domain’s DNS setup relies on at least one primary (authoritative source of truth) and usually one or more secondary name servers that answer the same queries for redundancy. Keeping those servers in sync requires some way to copy the zone’s full record set from the primary to each secondary, and AXFR — Authoritative Transfer — is the mechanism DNS was originally designed to use for exactly that. RFC 1035 first defined AXFR as part of the core DNS specification, and RFC 5936, also tracked in the IETF Datatracker, later replaced that original, underspecified definition with a precise, interoperable protocol description: a secondary sends an AXFR query, and the primary responds with every record in the zone in a single, ordered transfer, rather than the one-record-type-at-a-time answers an ordinary DNS lookup returns. In practice, a secondary first checks the zone’s SOA record serial number against its own copy, and only pulls a full transfer when the serial has actually changed — see SOA records explained for what the serial and the SOA’s other four timing fields each control. A primary doesn’t have to wait for the secondary’s own polling schedule to catch that change, either: DNS NOTIFY lets it proactively tell each secondary right after an update, which is what usually triggers the AXFR in practice rather than the secondary stumbling onto a changed serial on its next scheduled check. “AXFR” specifically means a full transfer of every record; IXFR is the incremental alternative defined in RFC 1995 that sends only what changed since the secondary’s last known serial, which most authoritative servers prefer whenever they can reconstruct that diff.

How do AXFR, IXFR, NOTIFY and TSIG fit together?

Zone replication is a small family of standards, and the names are easy to mix up:

MechanismDefined inWhat it does
SOA serial pollingRFC 1035Secondary compares the primary’s SOA serial with its own copy on a timer
NOTIFYRFC 1996Primary tells secondaries “the zone changed” straight away
AXFRRFC 5936Full copy of every record in the zone, over TCP
IXFRRFC 1995Only the changes since a given serial
TSIGRFC 8945Shared-key signature that authenticates each transfer request and response
XoTRFC 9103Runs AXFR/IXFR inside TLS so the zone can’t be read in transit

RFC 5936 also fixes the transport and the shape of a transfer. AXFR runs over TCP; the RFC states that AXFR over UDP is not defined. The first and last records of every transfer are the zone’s SOA record, which is how a client knows the copy is complete. A secondary that receives a broken transfer must throw it away and keep serving its previous copy.

What does an open zone transfer actually return?

A normal DNS query — looking up a domain’s MX record, or its A record for a specific hostname — only ever returns the one record type and name asked for. AXFR is categorically different: it returns the zone’s entire contents in one response, which is precisely why it needs to be restricted to a domain’s own authorized secondary servers rather than answered for anyone who asks. RFC 8499’s terminology section defines a zone transfer the same way — a complete copy of a zone — and that completeness is the whole risk. A zone often contains internal or staging subdomains, hostnames for infrastructure that was never meant to be publicly advertised, and enough naming-convention detail to reveal what software or vendors a domain relies on, none of which would normally surface from ordinary, targeted lookups.

This is what the leak looks like from the requester’s side (illustrative output; the zone, names and documentation addresses are made up for this example):

$ dig axfr @ns1.example.com example.com

; <<>> DiG 9.18 <<>> axfr @ns1.example.com example.com
;; global options: +cmd
example.com.            3600 IN SOA  ns1.example.com. hostmaster.example.com. 2026111001 7200 3600 1209600 3600
example.com.            3600 IN NS   ns1.example.com.
example.com.            3600 IN NS   ns2.example.net.
example.com.            3600 IN MX   10 mail.example.com.
mail.example.com.       3600 IN A    192.0.2.25
vpn.example.com.        3600 IN A    192.0.2.40
staging-db.example.com. 3600 IN A    198.51.100.12
build.example.com.      3600 IN A    198.51.100.30
example.com.            3600 IN SOA  ns1.example.com. hostmaster.example.com. 2026111001 7200 3600 1209600 3600
;; XFR size: 9 records (messages 1, bytes 412)

Nothing in that list is secret in the cryptographic sense, since each name can be looked up by anyone who already knows it. The point is that the requester didn’t know vpn, staging-db or build existed, and now has a ready-made list of hosts to probe.

Doesn’t the standard already say transfers should be restricted?

It does, after a fashion. RFC 5936 §5 notes that restricting AXFR “was not envisioned in the original design of the DNS” but acknowledges it has become a requirement, whether to keep the bulk zone concealed or to spare servers the load. Its rules for implementations are that DNS software SHOULD provide a way to restrict AXFR to specific clients, SHOULD allow access by IP address and range, is RECOMMENDED to support TSIG-based access control, and SHOULD NOT ship with a default policy of “open to all”. On software that follows that rule, an open transfer means someone configured it that way, for example with an explicit “allow any” left over from setup or testing, so the place to look is the configuration rather than the defaults.

How do you confirm whether your domain is affected?

The check is a single command, run from any machine outside your own network so you’re testing what the outside world actually sees: dig axfr @<nameserver-address> yourdomain.com, repeated against each name server listed in your domain’s NS records. A correctly configured server refuses the request outright. A misconfigured one prints the entire zone file to your terminal, record by record — an unambiguous result either way. AdminKit’s DNS lookup tool will show you the NS records to test against, and AdminKit’s Whois/RDAP lookup tool confirms which registrar and hosting setup is actually authoritative for the domain if the NS records look unexpected.

dig NS example.com +short
dig axfr @ns1.example.com example.com
dig axfr @ns2.example.net example.com

A server that refuses prints only this (real dig 9.18 output format):

; <<>> DiG 9.18 <<>> axfr @ns1.example.com example.com
; (1 server found)
;; global options: +cmd
; Transfer failed.
ResultMeaningNext step
; Transfer failed.The server refused the transferRepeat for every NS, over IPv4 and IPv6
A full record list ending with the SOAOpen zone transferRestrict it (next section), then re-test
connection timed out or connection refusedTCP 53 is filtered or closed for youFine for AXFR; check normal TCP DNS still works for large answers
Different results from different name serversOne server’s configuration differsFix the outlier; it is often an old self-hosted server left in the NS set

Test every address of every name server, because a server can be closed on one address and open on another. If you run a hidden primary that is not listed in NS, test it too if it is reachable from the internet.

How do you fix an open zone transfer?

Every common authoritative DNS server supports restricting AXFR to a named list of IP addresses — your own secondary servers, and nothing else. BIND uses an allow-transfer directive, PowerDNS uses allow-axfr-ips, and managed DNS providers almost universally disable open zone transfer by default, meaning most domains on managed DNS are never exposed to this in the first place. Cloudflare’s own documentation shows exactly this pattern in a real managed-DNS setup, instructing secondary-DNS customers to allow-list a specific, published set of source IP addresses for AXFR/IXFR rather than leaving transfers open to any requester; the check above is still worth running once, since a misconfiguration (an old self-hosted name server left in the NS set, for example) can reintroduce the problem even on an otherwise managed domain.

# BIND 9: only the secondary at 192.0.2.53, or anyone holding the TSIG key
key "xfr-key" { algorithm hmac-sha256; secret "<base64 secret>"; };
zone "example.com" {
    type primary;
    file "example.com.zone";
    allow-transfer { 192.0.2.53; key "xfr-key"; };
};

# PowerDNS Authoritative (pdns.conf)
allow-axfr-ips=192.0.2.53/32
# or, if no secondary pulls from this server at all:
disable-axfr=yes

The BIND 9 reference lists the current default for allow-transfer as none, and a zone-level statement overrides one set in options, so check both places. The PowerDNS settings reference gives allow-axfr-ips a default of 127.0.0.0/8,::1 and carries a warning worth reading: the list applies only to transfers without TSIG, so a client holding an allowed TSIG key can transfer from anywhere.

Does TSIG or TLS protect the transfer itself?

Where a secondary’s IP address isn’t stable, TSIG authenticates each transfer request with a shared cryptographic key instead of, or alongside, an IP allow-list, and keeps working correctly even if that address changes. RFC 8945 is the current TSIG specification. What TSIG does not do is hide the data: RFC 9103 points out that zone transfers travel in cleartext, so anyone who can watch the network path between primary and secondary can collect the zone, and defines XFR over TLS (XoT) to close that gap. BIND supports this through the transport tls option on allow-transfer. Restricting who can request a transfer is a separate concern from confirming what was actually received matched what the primary published; a ZONEMD record addresses the latter by letting a recipient verify a received zone’s digest against the one the primary signed.

What should you check alongside zone transfers?

Zone transfer exposure and delegation correctness are two different ways a domain’s DNS setup can be wrong without anyone noticing day to day — see our guide on glue records and lame delegation for the delegation side, and DNSSEC: what it actually protects for a related but distinct DNS-trust guarantee that an open AXFR does nothing to provide.

This guide is general information, not a security audit of your specific network — see our disclaimer for what AdminKit's guidance does and does not commit to.

Frequently asked questions

What is AXFR for, when it's working as intended?

AXFR keeps a domain's secondary (backup) name servers synchronized with its primary. RFC 5936 defines the exact request/response mechanics: a secondary sends an AXFR query to the primary and receives the zone's complete record set back in one transfer, which is how most DNS providers replicate a zone across redundant servers without manually copying records. This is a routine, necessary operation between a domain's own name servers — the problem is only when a server performs it for a requester that isn't one of those authorized secondaries.

Why is an open AXFR considered a leak, specifically?

Because a zone file is far more than the handful of public records someone would normally look up one at a time. A full zone transfer typically includes every subdomain's A/AAAA records, internal or staging hostnames that were never meant to be advertised, MX and TXT records, and sometimes hostnames that reveal internal naming conventions or third-party vendors in use. A normal DNS lookup only returns the specific record type and name you ask for; AXFR returns everything at once, which is exactly why RFC 1035's original definition of the mechanism assumed it would only ever be used between trusted, authorized servers.

How do I check whether my own domain allows open zone transfers?

From a machine outside your own network, run `dig axfr @<nameserver> <yourdomain>` against each of your domain's authoritative name servers (found via an NS lookup). If the server is correctly configured, it refuses the request with a message such as 'Transfer failed' or a REFUSED response; if it's misconfigured, it returns the full zone contents right there in the terminal output. AdminKit's DNS lookup tool shows you which name servers to test against as a starting point.

How do I fix an open zone transfer?

Configure your authoritative name server software to restrict AXFR to an explicit allow-list of IP addresses — your own secondary servers only — rather than answering transfer requests from any source. Every major DNS server implementation (BIND's `allow-transfer`, PowerDNS's `allow-axfr-ips`, and the equivalent setting on managed DNS providers) supports this restriction; if you use a managed DNS provider, zone transfer is very often disabled by default and only needs to be confirmed, not configured from scratch.

Does disabling open AXFR break anything for normal visitors?

No. Ordinary DNS resolution — the lookups browsers, mail servers and every other DNS client perform — uses individual record queries, never AXFR. Restricting zone transfers to your own authorized secondary servers has no effect on how your domain resolves for the public; it only removes the ability for an arbitrary third party to request the entire zone in one request.

Want AdminKit to watch this for you?

Free checks tell you the state today. Protective DNS and monitoring tell you when it changes.

Huy Nguyen (David), Founder and CEO of Netbase JSC

Talk to an expert

Huy Nguyen (David), Founder & CEO, Netbase JSC

Ask whether this fix applies to your setup, or get a second pair of eyes on your DNS and mail records.