Export All DNS Zones
I was in the process of enabling DNS scavenging following the steps in this blog post. I’m used to it already being on but going into an existing environment with it disabled & enabling it could be bad. I was at the “enable” phase mentioned in the blog when I thought that it would be nice to have an export of all the zones just in case. While I’m sure there are other solutions, this is mine.
- Browse to C:\Windows\System32\dns.
- Create a folder called export.
- Open a command prompt.
- Browse to C:\Temp.
- Run the following commands:
dnscmd /enumzones > AllZones.txt
for /f %a in (AllZones.txt) do dnscmd /ZoneExport %a export\%a.txt
- In the export folder you will now have a text file with an export for every zone (forward & reverse) in your DNS server.
- Now create a subfolder in the YYYYMMDD format under the export folder created earlier.
- Move all the text files to that folder.