DNS backups are a bit complicated, you need to backup and restore each zone individually with files that are in a static location in System32. Most sources I found used
dnscmd which is too DOS for me, we need to PowerShell it up. I ended up finding that Add-DnsServerPrimaryZone would work for my needs despite what some sources said about there being no PowerShell way to do this.
This script utilizes my email script submodule.
- The exported files are plaintext
- When exporting you can only specify a file name not location. The files can only go to
C:\Windows\System32\dnsand must be moved from there.
Updates: 2022-04-22: Added a check for
arpa specifically as it was an issue on my home DNS server.
Another basic script
An overview on the cmdlets and commands
Docs on DNSServer Module