Copy DNS Zones between Windows DNS Servers
Written on March 4, 2015

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


There's no commenting functionality here. If you'd like to comment, please either mention me (@[email protected]) on Mastodon or email me. I don't have any logging or analytics running on this website, so if you found something useful or interesting it would mean a lot to hear from you.