DNS Zone Transfer Security: Stop Unauthorized AXFR Attacks
Quick Answer
DNS Zone Transfer Security protects sensitive DNS records from unauthorized AXFR requests. Learn how to secure zone transfers using TSIG authentication, restrict server access, configure DNS permissions, and monitor transfer activity to prevent DNS data exposure and strengthen network security.
DNS (Domain Name System) connects users to websites, email servers, and other online services by translating domain names into IP addresses. It also helps organizations manage their internet-facing infrastructure. If DNS is not properly secured, its configuration may reveal sensitive information. One risk is an unauthorized DNS zone transfer, which can give attackers a complete copy of a domain’s DNS records.
Zone transfers synchronize DNS data between primary and secondary name servers, helping maintain consistency and availability. But if a server permits unrestricted transfers, unauthorized users may access valuable details about an organization’s network.
DNS zone transfer security prevents unauthorized users from copying DNS records by restricting zone transfers to trusted secondary name servers. Proper access controls, TSIG authentication, and DNS monitoring help organizations prevent unauthorized AXFR requests, protect infrastructure information, and reduce DNS exposure. This article explains how AXFR and IXFR work, the risks of unrestricted transfers, and practical ways to secure DNS environments.
What Is a DNS Zone Transfer?
A DNS zone transfer copies DNS records from one name server to another, typically to keep primary and secondary DNS servers synchronized.
A DNS zone contains important information about a domain, including:
- A records: Connect domain names to IPv4 addresses.
- AAAA records: Connect domain names to IPv6 addresses.
- MX records: Identify mail servers responsible for receiving emails.
- NS records: Identify authoritative name servers.
- CNAME records: Point one domain name to another.
- TXT records: Store additional information, including SPF and domain verification data.
- SRV records: Identify servers providing specific services.
Zone transfers help ensure that secondary DNS servers maintain updated copies of the primary server’s zone data.
There are two common types of DNS zone transfers:
- Full Zone Transfer (AXFR): AXFR transfers a complete DNS zone from a primary server to a secondary server, giving the secondary an entire copy of the zone.
- Incremental Zone Transfer (IXFR): IXFR transfers only DNS changes made since the last successful synchronization, reducing bandwidth use and improving transfer efficiency.
Although these mechanisms support reliable DNS operations, improper access controls can expose DNS information to unauthorized parties.

What Is an Unauthorized AXFR Attack?
An unauthorized AXFR attack happens when a person or automated system obtains a complete DNS zone transfer without permission. Zone transfers should normally be limited to approved secondary DNS servers, but a misconfigured server may accept AXFR requests from any IP address. An attacker who exploits this weakness can retrieve DNS records for the target domain. Unlike typical DNS queries, which return information about individual records, a successful AXFR (Full Zone Transfer) request can expose a much broader view of the domain’s DNS infrastructure.
For example, an exposed DNS zone might reveal:
- Internal and external server hostnames.
- Mail server configurations.
- Subdomains and application endpoints.
- Development and staging environments.
- VPN and remote access infrastructure.
- DNS record relationships.
This information can help attackers understand an organization’s infrastructure and identify potential targets for further attacks.
Why Is DNS Zone Transfer Security Important?
DNS zone transfer security matters because DNS records can reveal details about an organization’s digital environment. While individual records may be publicly accessible, transferring an entire zone at once can make infrastructure reconnaissance easier.
Here are some important security risks associated with unrestricted AXFR requests.
1. Exposure of Sensitive DNS Records
An improperly configured DNS server can expose records through unrestricted zone transfers. These records may reveal internal applications, test environments, administrative portals, or infrastructure services that organizations did not intend to make public. DNS records should never contain passwords or confidential credentials, but unnecessary exposure of hostnames and infrastructure can still increase security risk.
2. Easier Network Reconnaissance
Attackers often gather information before launching targeted cyberattacks. DNS zone transfers can expose useful details: a successful AXFR request may reveal subdomains, server names, and service endpoints. Attackers can use these details to find outdated applications, exposed services, and potentially vulnerable systems. Restricting zone transfers makes unauthorized infrastructure discovery more difficult.
3. Increased Phishing and Spoofing Risks
DNS records, including MX and TXT records, can expose details about an organization’s email infrastructure. Attackers may use this information to better understand email configurations and craft targeted phishing messages. For instance, identifying mail-related subdomains can help them imitate legitimate organizational services. Securing DNS and configuring SPF, DKIM, and DMARC can strengthen email authentication and reduce the risk of domain spoofing.
4. Exposure of Internal Infrastructure
Organizations that maintain separate internal and external DNS zones risk exposing internal records if those records are mistakenly added to a publicly accessible zone. Unauthorized transfers could reveal internal naming conventions and infrastructure details, helping attackers identify administrative systems, internal applications, and remote access services.

How to Prevent Unauthorized AXFR Attacks
Prevent unauthorized AXFR attacks by configuring DNS servers correctly, restricting access, requiring authentication, and monitoring activity continuously. These practices help reduce the risk of exposing DNS information.
1. Restrict Zone Transfers to Authorized Servers
Configure DNS servers to allow zone transfers only to approved secondary name servers. Maintain an allowlist of their IP addresses and reject all other transfer requests.
For example, a BIND DNS server can use the following configuration:
zone "example.com" {
type master;
file "/etc/bind/db.example.com";
allow-transfer {
192.0.2.10;
192.0.2.20;
};
};
Allow zone transfers only from the specified IP addresses. Avoid configurations that permit transfers from any source, and review access permissions whenever secondary DNS servers are added, removed, or replaced.
2. Use Transaction Signature (TSIG) Authentication
Transaction Signature (TSIG) adds authentication and integrity protection to DNS communications, including zone transfers. It uses shared secret keys and cryptographic message authentication to verify that DNS messages come from trusted parties and have not been altered. When configured correctly, primary and secondary DNS servers use matching TSIG keys to authenticate transfer requests. However, TSIG does not encrypt DNS zone transfer data, so organizations should use additional network security controls when confidentiality is required.
Benefits of TSIG include:
- Authenticated communication between DNS servers.
- Protection against unauthorized transfer requests.
- Message integrity verification.
- Reduced risk of DNS transfer impersonation.
Organizations should generate strong, unique TSIG keys, protect their storage, and rotate them periodically.
3. Configure Firewall Rules
Firewall restrictions add another layer of protection against unauthorized DNS zone transfers. When possible, configure firewall policies to permit DNS traffic only from trusted systems.
Important considerations include:
- Allow TCP port 53 traffic only from authorized secondary DNS servers for zone transfers.
- Restrict unnecessary external access to DNS infrastructure.
- Monitor unusual connection attempts.
- Review firewall rules regularly.
- Remove outdated IP addresses from allowlists.
DNS zone transfers such as AXFR and IXFR use TCP port 53. Restricting inbound TCP port 53 traffic to authorized secondary DNS servers can help prevent unauthorized transfer requests. DNS queries commonly use both UDP and TCP port 53, so firewall policies should account for legitimate DNS traffic while limiting unnecessary access. Firewall rules should supplement, not replace, DNS-level zone transfer restrictions.
4. Separate Internal and External DNS Zones
Keep internal DNS records off publicly accessible DNS servers. Separate internal and external DNS zones to control what internet users can see, which is an important part of email security. The external zone can hold public website and email records, while the internal zone holds private application and infrastructure records. This limits sensitive infrastructure information exposed through accidental zone transfers or misconfigured DNS services.

5. Disable Unnecessary Zone Transfers
Not every DNS server needs to support zone transfers. If a server does not sync records with secondary servers, disable zone transfers to remove an unnecessary access point and reduce the risk of accidental exposure. First, confirm that the server does not support secondary DNS infrastructure or another synchronization process.
6. Monitor DNS Zone Transfer Activity
Continuously monitor DNS logs for unusual AXFR and IXFR requests, particularly those originating from unfamiliar IP addresses. Investigate successful transfers from unrecognized systems, repeated refused requests, unexpected transfer attempts, and changes to zone transfer permissions. Correlate these events with DNS server logs and network activity to determine whether they indicate misconfiguration or unauthorized access.
Security teams should investigate:
- Repeated failed AXFR requests.
- Successful transfers from unknown IP addresses.
- Unexpected DNS synchronization activity.
- Changes to zone transfer permissions.
- Unusual DNS traffic patterns.
Organizations can integrate DNS monitoring with Security Information and Event Management (SIEM) platforms to detect suspicious activity and generate security alerts.
How to Test Your DNS Server for Unauthorized AXFR Requests
Regular testing helps determine whether a DNS server allows unrestricted zone transfers. One common method is using the dig command-line utility.
Administrators can execute the following command:
dig AXFR example.com @ns1.example.com
Replace example.com with your domain and ns1.example.com with the authoritative DNS server you want to test.
The command requests a full DNS zone transfer from the specified server.
Understanding the results:
- Successful transfer: The server returns DNS records. If the requesting system is not authorized, this indicates a potential security misconfiguration.
- Transfer refused: The server rejects the request, suggesting that zone transfer restrictions are active.
- Connection timeout: The server does not respond within the expected period. This may indicate network restrictions, firewall rules, or an unavailable service.
Administrators can repeat the AXFR test against each authoritative name server to verify that zone transfer restrictions are consistently applied. For example, run the dig AXFR command against each server listed in the domain’s NS records. Compare the responses to identify servers that may allow unauthorized transfers. Administrators can also use nslookup to investigate DNS servers and their configurations. Test only domains and DNS servers you own or have explicit permission to assess.

Best Practices for Maintaining DNS Zone Transfer Security
Preventing unauthorized AXFR attacks is not a one-time activity. DNS configurations change as organizations add new servers, migrate infrastructure, and update network policies.
The following best practices help maintain long-term DNS security:
- Audit DNS configurations: Review zone transfer permissions regularly to identify unrestricted access.
- Maintain authorized server lists: Keep secondary DNS server IP addresses accurate and updated.
- Use TSIG authentication: Protect zone transfers with cryptographic authentication by using encryption keys and secure authentication mechanisms to ensure that only authorized DNS servers can access and exchange zone data. .
- Secure DNS infrastructure: Apply security patches and update DNS server software.
- Monitor DNS logs: Investigate unexpected AXFR and IXFR requests.
- Review DNS records: Remove outdated subdomains and unnecessary records.
- Protect internal zones: Prevent internal DNS information from being exposed publicly.
- Perform regular security assessments: Test DNS configurations to identify potential weaknesses.
Combining these practices with broader network security controls helps organizations maintain reliable and secure DNS infrastructure.

Securing DNS zone transfers helps protect an organization’s network infrastructure. AXFR and IXFR support record synchronization between authorized name servers, but misconfigured transfers can reveal valuable infrastructure details to attackers and increase the risk of a phishing attack.
Reduce this risk by limiting transfers to trusted IP addresses, using TSIG authentication, setting firewall rules, separating internal and external DNS zones, and monitoring for suspicious DNS activity. Regular DNS security assessments can uncover configuration weaknesses before they are exploited. These measures help prevent unauthorized AXFR attacks, limit infrastructure exposure, reduce phishing attack risks, and support a more secure, reliable DNS environment.
General Manager
General Manager at DuoCircle. Product strategy and commercial lead across the email security portfolio.
Secure your email infrastructure
Protect, authenticate, and deliver. Contact our team to find the right solution.