Spilling Over an Eclectic Mix of Thoughts for Your Thrills.


Quick Tip for Server 2008 DNS Management

September 24, 2011 · 2 Comments

Help, I Have Lots of New Domain DNS Entries to Setup!

I recently had to setup a boatload of hosted Google Adsense domains with Server 2008 DNS Management Console and was not enjoying the repetitive nature of the task. I needed to find a way to "template" the DNS entries and then just update the domain name since all of the other information was identical. What I came up with is not earth-shattering but, for non-server admin types that haven't yet learned Windows Powershell, I hope the following is useful.

The instructions assume that you have successfully created DNS entries using Windows Server 2003-2008 DNS Mangement Console before. The first step in the process is to create a DNS entry that will be used as the template for all the other domains or use one that has already been created. Once you have your DNS  template entry created and tested, you will need to open the %SystemRoot%\system32\dns folder on your server and find the corresponding ".dns" file that matches the name of your template entry. 

NOTE: If you can't see the extensions goto Control Panel > Appearance > Folder Options >View tab > scroll down the list until you find a checkbox for "Hide extensions for known file types" and uncheck the box > click the "Apply to Folders" button at top and return to the DNS folder you opened previously.

I have included a sample DNS file below for hosted Google Adsense domains, replace XX with appropriate info. Don't get nervous on info for zone version or zone serial just use a number higher than the number of domains you are already hosting like say 50 or 500 in my experience this in not critical info.

;  Database file domainName.com.dns for domainName.com zone.
;      Zone version:  xx

@                       IN  SOA ns1.YourNameServer.com. support.domainName.com. (
                                XX           ; serial number
                                900          ; refresh
                                600          ; retry
                                86400        ; expire
                                3600       ) ; default TTL

;  Zone NS records

@                       0    NS    ns1.googleghs.com.
ns1.googleghs.com.      A
@                       0    NS    ns2.googleghs.com.
ns2.googleghs.com.      A
@                       0    NS    ns3.googleghs.com.
ns3.googleghs.com.      A
@                       0    NS    ns4.googleghs.com.
ns4.googleghs.com.      A

;  Zone records

@                       A
@                       A
@                       A
@                       A
www                     CNAME    pub-XXXXXXXXXXXXXXXX.afd.ghs.google.com.

Once have located the appropriate .dns file copy it and paste the copy in the same folder and rename it to a new domain you need to add e.g. newDomainName.com.dns. Now open the .dns file in your favorite text editor and update Database file domainName.com.dns for domainName.com zone header, zone version, serial version and save. IMPORTANT, check that your text editor has not added .txt or other file extension to the .dns file you just edited. No biggie if it did, just rename it back to .dns. Now in DNS Management Console right click on dns list and select New Zone see below:

Start New DNS Zone Wizard

Now enter the new domain name which should be the same name as the .dns file you created click "Next" and then "Finish" now repeat for all your other domains. I used Windows Word and a csv file with my domain names and sequential numbers for the serial and zone version to create all of the .dns files in less than 5 minutes.

 DNS file

I hope this helps and if you have a better or quicker solution please don't hesitate to post a link or text on how to do it.



Tags: DNS · Server 2008

2 responses so far ↓

  • 1 Satish // Nov 19, 2011 at 2:17 AM

    Thanks for the information. It really helped me.
  • 2 Spills // Nov 20, 2011 at 6:56 AM

    I am glad to hear it, if you have any suggestions on how to make the article better please don't hesitate.


Leave a Comment

Leave this field empty: