Open AXFR: Your Nameserver Handing Out the Whole Zone
Overview
A nameserver with allow-transfer set to any hands a complete zone dump to anyone who runs dig axfr, exposing every subdomain, internal hostname, VPN endpoint and mail exchanger as a ready-made reconnaissance map.
At a glance
- Symptom
- Unauthenticated dig axfr query against the primary or any misconfigured secondary nameserver
- Likely cause
- allow-transfer clause missing or set to { any; } on authoritative zones
- Impact
- Full zone contents exposed: internal hosts, staging systems, VPN gateways, mail servers, and naming conventions for phishing pretexts.
- Verification signal
- Re-run the detection test and a controlled negative-path test.
- Safe correction
- Restrict allow-transfer to a TSIG-keyed ACL, deny any, firewall TCP/53, and log xfer-out attempts
- Rollback or recovery
- Restore the exported configuration if the new control blocks required production traffic, then narrow the policy before redeployment.
The Trap
Unrestricted AXFR (full zone transfer) on authoritative DNS servers, where the allow-transfer clause in named.conf is either absent or explicitly set to any. An absent clause allows transfers to all hosts on BIND 9.18 and earlier; BIND 9.20 changed the default to none.
The Default State
BIND9’s zone transfer behaviour depends entirely on operator configuration, and the common shortcut during initial setup is to omit allow-transfer from the zone or options block entirely, or to set it to { any; } so secondaries never fail to sync during testing. Once the zone goes live, nobody revisits that clause. PowerDNS and Microsoft DNS carry the same risk when zone transfer restrictions aren’t paired with TSIG or IP ACLs; check any managed provider’s transfer settings rather than assuming they are closed.
The Blast Radius
Any host on the internet can run dig axfr domain.com @ns1.domain.com and receive the entire zone file over one TCP/53 connection: every subdomain, every internal hostname, every VPN concentrator, staging environment, mail exchanger, and forgotten legacy A record. This isn’t guesswork reconnaissance against a wordlist; it’s a complete, authoritative inventory of the attack surface handed over unauthenticated. Attackers use it to identify unpatched staging servers still resolving to production IP ranges, to enumerate internal naming conventions for spear-phishing pretexts, and to spot split-horizon leakage where internal-only records were accidentally published externally. Combined with a subsequent SOA/NS enumeration, it also reveals which secondary servers exist, widening the target list for a follow-on transfer attempt or cache-poisoning window. The exposure is silent: standard query logging rarely distinguishes a legitimate secondary’s AXFR from a hostile one unless transfer-specific logging is enabled.
The Lead Mechanic Fix
Lock transfers to an explicit ACL keyed on TSIG, not IP alone, since an IP ACL trusts anything that can send from those addresses while a key authenticates the requester. Generate a shared secret with tsig-keygen transfer-key, then in named.conf: acl secondaries { key transfer-key; }; options { allow-transfer { secondaries; }; };, applying the same override per-zone if any zone historically had a laxer setting. Verify with dig axfr domain.com @ns1.domain.com from an unauthenticated host and confirm it returns Transfer failed. For split-horizon estates, additionally set allow-query separately from allow-transfer so ordinary queries aren’t accidentally blocked while transfers are locked down. Do not simply firewall TCP/53, since ordinary DNS queries also use TCP (RFC 7766); instead enable logging { channel xfer-log { file "xfer.log"; severity info; }; category xfer-out { xfer-log; }; category security { xfer-log; }; }; to record transfers and denied requests, and alert on any attempt from outside the secondaries ACL.
Related reading
Apply the safer control
Before you change production
Confirm the affected scope, export the current configuration, and test the replacement control in a non-production environment first.
Fix commands and configuration
tsig-keygen transfer-keynamed.confacl secondaries { key transfer-key; }; options { allow-transfer { secondaries; }; };Verify, roll back or escalate
Verify
Re-run the detection test and a controlled negative-path test. Confirm the unsafe behaviour is blocked while approved traffic still succeeds.
Rollback
Restore the exported configuration if the new control blocks required production traffic, then narrow the policy before redeployment.
Escalate
Escalate when the blast radius is uncertain, the control cannot be tested safely, or remediation requires an outage or security exception.
Fixed? Get the next one before it hits you: The KBY Brief
Practical fixes for the systems you run, by email about twice a week. Unsubscribe at any time.
About this page
Credited to
Dates
Published
Last updated
Corrections
No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.
Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.