Restrict Windows DNS zone transfers with Add-DnsServerZoneTransferPolicy (DENY or IGNORE only) and run DNS policy on secondary servers: what AXFR/IXFR copies per zone scope and how to copy scopes, subnets and policies.
Home › Guides › Zone transfer policies and secondary servers
Last updated 23 November 2026
Windows Server 2016 and later can control zone transfers with zone transfer policies, and DNS policy deployments that use zone scopes can run on secondary servers too. Two things trip people up. First, a zone transfer policy can only DENY (answer with SERV_FAIL) or IGNORE (no answer); there is no ALLOW, so an allow list is written as IGNORE with an NE criterion, for example Add-DnsServerZoneTransferPolicy -Name "NorthAmericaPolicy" -Action IGNORE -ClientSubnet "ne,AllowedSubnet". Second, AXFR and IXFR move the records of each zone scope, but not the zone scopes themselves, the DNS client subnets or the query resolution policies. On every secondary you create the secondary zone, the client subnets, the zone scopes and the policies yourself; once a scope exists there, its records arrive by zone transfer from the primary.
Based on Microsoft's primary-secondary geo-location article and the DNS Policies Overview:
| Item | Copied by zone transfer? | How it gets to the secondary |
|---|---|---|
| Records in the default zone scope | Yes (AXFR, then IXFR after notifications) | Normal secondary zone pointed at the primary |
| Records in an added zone scope | Yes, once the same scope exists on the secondary | Scope level transfer: the scope requests its own transfers from the primary |
| The zone scopes themselves | No | Get-DnsServerZoneScope on the primary piped into Add-DnsServerZoneScope on the secondary |
| DNS client subnets | No | Get-DnsServerClientSubnet piped into Add-DnsServerClientSubnet |
| Query resolution policies | No | Get-DnsServerQueryResolutionPolicy piped into Add-DnsServerQueryResolutionPolicy |
| Zone transfer policies | Not covered in Microsoft's articles | They are set on the server that sends the transfer, normally the primary |
The last row's second cell is my reading: a zone transfer policy decides whether this server answers a transfer request, so it belongs on the server that hosts the copy being requested.
A normal primary-secondary setup works like this in Microsoft's description: create the primary zone, create the secondary zone and name the primary, add the secondaries as trusted secondaries on the primary zone, let the secondary make a full transfer (AXFR, RFC 5936), then the primary sends notifications on changes and the secondary asks for incremental transfers (IXFR, RFC 1995).
For zones with scopes, every AXFR or IXFR request from the zone carries an EDNS0 OPT record (RFC 6891) with option ID 65433 by default, and the option value is the name of the zone scope being requested. When the primary gets such a request from a trusted secondary, it replies with the transfer data of that scope and the same OPT record, and the secondary updates that scope. The primary then keeps a list of secondaries that asked for that scope, and later changes in the scope trigger an IXFR notification with the same OPT record. Microsoft doesn't say what happens if the primary has no scope with the requested name beyond "if the primary server has that zone scope it responds".
Microsoft's example runs everything from one management machine against PrimaryServer (10.0.0.1), SecondaryServer1 (10.0.0.2) and SecondaryServer2 (10.0.0.3). Membership in DnsAdmins or equivalent is required.
Add-DnsServerSecondaryZone -Name "woodgrove.com" -ZoneFile "woodgrove.com.dns" -MasterServers 10.0.0.1 -ComputerName SecondaryServer1 Add-DnsServerSecondaryZone -Name "woodgrove.com" -ZoneFile "woodgrove.com.dns" -MasterServers 10.0.0.1 -ComputerName SecondaryServer2
-MasterServers takes one or more IPv4 or IPv6 addresses of the zone's master servers.
Set-DnsServerPrimaryZone -Name "woodgrove.com" -Notify Notify -SecondaryServers "10.0.0.2,10.0.0.3" -SecureSecondaries TransferToSecureServers -ComputerName PrimaryServer
From the Set-DnsServerPrimaryZone reference:
-SecureSecondaries: NoTransfer (no transfers for this zone), TransferAnyServer, TransferToZoneNameServer (only servers in the zone's NS records) or TransferToSecureServers (only the listed secondary servers).-SecondaryServers: the IP addresses allowed to receive the zone by transfer.-Notify: NoNotify, Notify (all secondary servers) or NotifyServers, which needs the list in -NotifyServers.Microsoft's command passes both addresses as one quoted string, while the reference types -SecondaryServers as an array of IP addresses. If PowerShell rejects the string, write the list as -SecondaryServers 10.0.0.2,10.0.0.3 (my suggestion, not Microsoft's). If you use the name-servers-only option and the primary has several IP addresses on one adapter, see the zone transfer fails with Only to servers listed on the Name Servers tab guide.
Get-DnsServerClientSubnet -ComputerName PrimaryServer | Add-DnsServerClientSubnet -ComputerName SecondaryServer1 Get-DnsServerClientSubnet -ComputerName PrimaryServer | Add-DnsServerClientSubnet -ComputerName SecondaryServer2 Get-DnsServerZoneScope -ZoneName "woodgrove.com" -ComputerName PrimaryServer | Add-DnsServerZoneScope -ZoneName "woodgrove.com" -ComputerName SecondaryServer1 -ErrorAction Ignore Get-DnsServerZoneScope -ZoneName "woodgrove.com" -ComputerName PrimaryServer | Add-DnsServerZoneScope -ZoneName "woodgrove.com" -ComputerName SecondaryServer2 -ErrorAction Ignore $policy = Get-DnsServerQueryResolutionPolicy -ZoneName "woodgrove.com" -ComputerName PrimaryServer $policy | Add-DnsServerQueryResolutionPolicy -ZoneName "woodgrove.com" -ComputerName SecondaryServer1 $policy | Add-DnsServerQueryResolutionPolicy -ZoneName "woodgrove.com" -ComputerName SecondaryServer2
-ErrorAction Ignore is there because every zone already has a default zone scope that can't be created or deleted, so the pipeline's attempt to add it fails; you can also add only the non-default scopes by name. As soon as a scope exists on the secondary, it starts requesting transfers from the primary, so you don't add the records there. No policy is needed for the default scope. Microsoft notes these commands are for the initial setup and validation: later changes to subnets, scopes or policies on the primary are not pushed to the secondaries, so plan your own scripts to keep them in sync. Whether rerunning the same pipelines updates objects that already exist on the secondary is not covered in Microsoft's articles.
To ask for a transfer right away, run Start-DnsServerZoneTransfer -Name "woodgrove.com" on the secondary (incremental) or add -FullTransfer. The cmdlet compares the SOA version on the master first and does nothing if it is the same. Whether this cmdlet also refreshes the added zone scopes is not covered in Microsoft's articles.
A zone transfer policy decides whether the DNS server allows a zone transfer. It can be server level (applies to every zone transfer request on the server) or zone level (only requests for one hosted zone, the usual way to build block or allow lists). A zone level policy needs -ZoneName, the zone must exist, and removing the zone deletes its zone level policies.
-Action: DENY responds with SERV_FAIL, IGNORE sends no response. Those are the only two values.-ClientSubnet (a client subnet object from Add-DnsServerClientSubnet), -ServerInterfaceIP, -InternetProtocol (IPv4 or IPv6), -TransportProtocol (TCP or UDP) and -TimeOfDay, each written as operator,value,value with EQ and/or NE, at most one of each. Values after EQ are OR'd, values after NE are AND'd, so "EQ,NorthAmerica,Asia,NE,Europe" matches either of the first two and not Europe.-Condition: how several criteria combine, AND (default) or OR.-ProcessingOrder: higher numbers have lower precedence; a new policy goes in last by default. Policies of the same level need different processing orders.-Disable creates the policy turned off.The cmdlet description also lists FQDN and query type as criteria, but the syntax has no parameter for either, so I have left them out. How server level and zone level transfer policies are ordered against each other is only shown as a diagram in the DNS Policies Overview, so it isn't restated here.
Add-DnsServerClientSubnet -Name "AllowedSubnet" -IPv4Subnet 172.21.33.0/24 Add-DnsServerZoneTransferPolicy -Name "NorthAmericaPolicy" -Action IGNORE -ClientSubnet "ne,AllowedSubnet" Add-DnsServerZoneTransferPolicy -Name "InternalTransfers" -Action IGNORE -ServerInterfaceIP "ne,10.0.0.33" -PassThru Add-DnsServerZoneTransferPolicy -Name "InternalTransfers" -Action IGNORE -ServerInterfaceIP "ne,10.0.0.33" -PassThru -ZoneName "contoso.com"
-ServerInterfaceIP "eq,10.0.0.33" with the same policy name, which is the opposite: it ignores requests that do arrive on 10.0.0.33. Pick EQ or NE on purpose.-Name DenyTransferOfContosoToFabrikam -Zone contoso.com -Action DENY -ClientSubnet "EQ,192.168.1.0/24", is introduced as server level but names a zone, and its -ClientSubnet value is an address range rather than a client subnet name. In my reading -Zone binds to -ZoneName (PowerShell accepts unambiguous abbreviations), which makes it zone level; whether a raw subnet is accepted there isn't covered in the cmdlet reference, which describes -ClientSubnet as a client subnet criterion. Creating a client subnet object first, as in the AllowedSubnet example, follows the documented pattern.How zone transfer policies combine with the zone's own Zone Transfers setting (-SecureSecondaries) is not covered in Microsoft's articles; keep both consistent, so a secondary allowed by one isn't blocked by the other. The overview says new policies on read-only domain controllers load only after the DNS Server service restarts.
Get-DnsServerZoneTransferPolicy Get-DnsServerZoneTransferPolicy -ZoneName "contoso.com" Set-DnsServerZoneTransferPolicy -Name "InternalTransfers" -TransportProtocol "NE,TCP" -ServerInterfaceIP $Null Remove-DnsServerZoneTransferPolicy -Name "InternalTransfers" -ZoneName "contoso.com" -Force Get-DnsServerZoneTransferPolicy -ZoneName "contoso.com" | Remove-DnsServerZoneTransferPolicy -ZoneName "contoso.com" -Force
Without -ZoneName, Get and Remove work on server level policies; with it, on that zone's policies. In the Set example $Null clears the server interface criterion. Removing a server level policy without -Force asks for confirmation. The last line, Microsoft's example, removes every zone transfer policy of contoso.com.
For single-server split-brain zones see split-brain DNS with DNS policy zone scopes; for blocking queries rather than transfers, see DNS policy query filters.
Look up DNS Server events such as 4013 and 4015 in the Windows Event ID Lookup, copy the zone transfer policy and zone scope lines from the PowerShell Cheat Sheet, pull zone names out of exported DNS server logs with the Regex Tester, work out the subnet for a zone transfer allow list with the IPv4 Subnet Calculator or IPv6 Subnet Calculator, and identify the adapters on a multihomed DNS server with the MAC Vendor Lookup. Related guides: split-brain DNS with DNS policy zone scopes, DNS policy query filters, DNS zone transfer fails with the Name Servers tab option, zone transfer settings reset after a replication scope change and common Windows DNS Server and DHCP Server errors.
Setting up the primary server first? See geo-location DNS policy and weighted load balancing.
Every Windows DNS Server and DHCP Server event and symptom in one place: common Windows DNS Server and DHCP Server errors.
Zone transfer policies have no ALLOW action, only DENY and IGNORE. Create a client subnet object for the allowed range with Add-DnsServerClientSubnet, then add a policy with -Action IGNORE and -ClientSubnet set to ne plus that subnet name, so requests from every other subnet are ignored.
DENY answers the transfer request with SERV_FAIL. IGNORE sends no response at all, so the requesting server waits and times out.
The records inside a zone scope are, but the scope itself is not. Create the same zone scopes on the secondary, for example by piping Get-DnsServerZoneScope from the primary into Add-DnsServerZoneScope, and the scopes then request their records from the primary.
No. Microsoft copies them with Get-DnsServerClientSubnet piped into Add-DnsServerClientSubnet and Get-DnsServerQueryResolutionPolicy piped into Add-DnsServerQueryResolutionPolicy for each secondary, and says later changes need your own synchronization scripts.
Its AXFR or IXFR request carries an EDNS0 OPT record with option ID 65433 by default and the zone scope name as the value. A trusted primary that has that scope answers with the scope data and sends later change notifications with the same option.
Runbooks, checklists and helpdesk templates: IT Admin Packs on Gumroad.