Copy DNS Zones between Windows DNS Servers

Consider a scenario where you’re migrating Secondary DNS zones between multiple Windows DNS servers. This is a tedious process at best when completed via the GUI. Fortunately, PowerShell makes this considerably easier. With just one command, all Secondary zones can be copied across from Server A to Server B. This even works with old versions of Windows, provided you run the commands remotely from Windows Server 2012 R2’s DnsServer module:

Try it for yourself!

Get-DnsServerZone -ComputerName DNS1 | Where {$_.ZoneType -eq "Secondary"} | Add-DnsServerSecondaryZone -ComputerName DNS2
Written on March 4, 2015