Sunday, January 11, 2009

Add a forward dns lookup zone on command line

The following illustrates adding a forward DNS lookup zone on command prompt using dnscmd command
1. First, Assume your dns server name is "dnsserver", domain is "", and the dns zone which is to be created is "".

Now run the following command to create primary dnszone in DS integrated Active Directory. dnscmd dnsserver /zoneadd /dsprimary

Also to specify the storage location of zone information ,say domain level, run
dnsserver /zoneadd /dsprimary dsprimaryzone.myrootdns .com /dp /domain

3. To verify the zone is created, run

dnscmd dnsserver /zoneinfo
4.To create primary dnszone without integrated in to DS Active Directory(file based), run

dnscmd dnsserver /zoneadd /primary
5. To Create Primary dns zone and store zone information to a file, do the following
   i. Assume the file to which the zone information to be stored is dsprimaryzone.txt(created

dsprimaryzone.txt can be located at C:\windows\system32\dns)

ii. Run the following to create the dns zone and store info in to this file

dnscmd dnsserver /zoneadd /primary /file %windir%\system32\dns\dsprimaryzone.txt

Also to create primary from an existing zone file "dsprimaryzone.txt" , run

dnscmd dnsserver /zoneadd /primary /file %windir%\system32\dns\dsprimaryzone.txt /load

6. To Create Secondary zone for the zone ""on a second dns server, run the following on the second dns server(Assume the primary dns server ip address is

dnscmd /zoneadd /secondary

Also to store secondary zone information on forest, run

dnscmd /zoneadd /secondary /dp forest

7. To create stubzone, run

dnscmd /zoneadd /stub /file mystub.txt

8. To create forwarder dns zone, run

dnscmd /zoneadd /forwarder /file mystub.txt

Download dnscmd.exe from


Anonymous said...

test comment

Design by infinityskins.blogspot