I'm attempting to backup a primary, non-Active Directory, DNS server with PowerShell. It's a Windows Server 2012 Standard server with all of the updates applied, and only the DNS role installed. I found the code from this TechNet example
#Get DNS Server configuration and store it in ServerConfig.xml
Get-DnsServer | Export-Clixml -Path ServerConfig.xml
This part worked great, and spit everything out into an XML file. I ran through the file, and verified that all of the forward lookup zones, reverse lookup zones, and conditional forwarder zones were there.
I attempted to restore the XML configuration to another Windows Server 2012 Standard server with the DNS role installed using the restore command.
#Import the configuration from ServerConfig.xml and set it on TargetServer through CimSession
Import-Clixml -Path ServerConfig.xml | Set-DnsServer –CimSession TargetServer
The problem is only the conditional forwarder zones were restored. The forward lookup zones and reverse lookup zones didn't transfer.
Is there something I'm missing?