Location: Articles

Articles

Articles

How to export AD-integrated zones to file

By SuperUser Account on Sunday, November 25, 2007 6:08 PM

When making changes to your DNS zones, taking a file copy of your AD-integrated zones can be a useful thing to do. It not only provides a human-readable document of the state of the zone at the time of the change, but can also be used to recover a damaged or corrupt zone. This article describes how to backup the zone using the dnscmd.exe command line utility and provides some guidance on how the file might be used in a recovery scenario

DNS zone file information is stored by default in the %systemroot%\system32\dns folder. When the DNS Server service starts it loads zones from these files. This behavior is limited to any primary and secondary zones that are not AD integrated. The files will be named as <ZoneFQDN>.dns. When changes are made to the zone information, a backup of the zone file is placed in the %systemroot%\system32\dns\backup folder. Only one backup file is maintained – in other words, the backup will be overwritten by a new file when further changes are made to the zone.
 
Because AD-integrated zones are stored in the directory they do not have corresponding zone files. This makes sense because the zones are stored in, and loaded from, the directory.
 
When making changes to the DNS infrastructure, it is a good idea to take a backup of the AD-integrated zone information. This not only provides a handy, human-readable document of the status of the zone before the change, but can also provide a recovery mechanism if the change causes unforeseen problems.
 
Dnscmd.exe can be used to export the zone to a file. The syntax of the command is:
 
DnsCmd <ServerName> /ZoneExport <ZoneName> <ZoneExportFile>
    <ZoneName>   -- FQDN of zone to export
                    /Cache to export cache
 
As an example, let’s say we have a zone named north.com. The command to export the file would be:
 
DnsCmd NorthDC1 /ZoneExport north.com north.com.bak
 
The output from the command should look like this:
 
C:\>dnscmd /zoneexport north.com north.com.bak
DNS Server . exported zone north.com to file C:\WINDOWS\system32\dns\north.com.bak
Command completed successfully.
 
Note that the file will always be created in %systemroot%\system32\dns unless otherwise specified.
 
To recover a damaged AD-integrated zone using the zone backup file, follow the procedure described below. Note that this is a fairly drastic step with potentially high impact for replication, systems and users, so it should only be considered as a last resort. Ensure that you have tested the procedure and are familiar with it before attempting it in your production environment.
 
Delete the zone. If using the dnsmgmt.msc snap-in you will receive a warning that the zone will be removed from AD and from all DNS servers that load the zone from AD.
Rename your zone backup file to have a .dns extension, e.g.
ren %systemroot%\system32\dns\north.com.bak %systemroot%\system32\dns\north.com.dns
Create a new zone with the same FQDN as the zone you deleted in Step 1. If using the new zone wizard, ensure you uncheck the box next to Store the zone in Active Directory (available only if DNS server is a domain controller).
When prompted to create a new zone file or to use an existing file, choose the option to use an existing file. The wizard should automatically fill in the zone FQDN with the .dns extension. This should correspond to the renamed zone file from Step 2.
Complete the wizard.
Check that the zone information is as you would expect (i.e. it contains all the information from the backup).
Change the zone type to AD-integrated.
 
An alternative (but potentially more time-intensive) method of recovering a damaged AD-integrated zone would be to perform an authoritative restore from a backup.
 
For more information on Windows 2003 DNS, I would recommend the O'Reilly book:
 
http://www.oreilly.com/catalog/dnswinsvr/
 
 
Alexei
29th July 2006


Rating
Comments

By Sadiq Fazal @ Friday, March 21, 2008 10:01 AM

Hi everybody.

I have a W2000 SP4 Server running as PDC with Active Directory AND i have backup dc
. After some investigation i found out that
the Forward Lookup Zone on my PDC has no subfolders in the "domain zone".
Normally you should have those _MSDSC, _Sites, _TCP, _UDP etc..folders but even
after deinstalling DNS and Reinstalling, flushing, restart netlogon services (many time),rename netlogon file(in C:\winnt\system32\config) and
registering ( multiple
times ) i cant get those folders. The DNS-Server itself works well, adding
clients to the Domain works and they get registered in DNS too. I think that
my AD is somehow "broken" but i dont know what the cause and what the effect
is ( DNS or AD) .
LAN settings are correct ( PDC has itself as DNS, and registering itself). I
also get event 5781 ( dynamic registration failed) although i have activated
dyn.reg in the Forward Lookup Zone. Any ideas on this?

Regards;
Sadiq.Fazal
Email: Sadiq.Fazal@gmail.com


Click here to post a comment
Friends

Friends

Namescape

Ads

Your Home Page ..

Site Articles:

Add to Google

Add to My Yahoo!

Mail List Posts:

Add to Google

Add to My Yahoo!

Friends

Friends

ScriptLogic
AdventNet Banner
Copyright 2008 ActiveDir.org
Terms Of Use