# Backup / Restore Windows DNS

How do I backup the Windows DNS (AD) content, in a form that enables simple restore?

Partial restore, e.g. a sub-domain, is also nice to have. I am not looking for solutions involving full Windows system backup.

-

You can use dnscmd to dump the zone files to disk (although I think it excludes the glue records). Here's the batch file I run on our DC to back up our internal zones:

dnscmd /zoneprint <ZoneName> > C:\path\to\zone\file
<Lather, rinse, repeat>

xcopy /s /e /y c:\DNSBackup \\<Backup server>\path\

-
How would I restore a zone? –  gimel Jul 14 '09 at 9:40
dnscmd /zoneadd <Zone name> /primary /file <filename> /load –  RainyRat Jul 14 '09 at 9:52
@gimel: technet.microsoft.com/en-us/library/cc756116(WS.10).aspx describes the dnscmd app. I've managed to miss this app and embarrassingly it's been around for years. Now on my list of useful applets! –  John Rennie Jul 14 '09 at 9:54

I don't know of an elegant way to do this. You could do it by setting the zone back to a zone file instead of AD Integrated, then you can back up the zone file. However you'd have to manually set up replication from one of the DCs to all the others. I have seen this done, but if it were my network I'd be feeling uneasy with this solution. It would be OK if you only had one DC.

Could you enable zone transfers and back it up by doing selected "ls mydomain.local" comamnds in nslookup?

JR

-