Wednesday, 7 July 2010

Redundant DNS servers

A domain name normally has 2 DNS servers, but it is possible to increase this to ensure more redundancy, i.e. ensuring that a full datacenter failure doesn't bring down your domain.

I've added ns5.openmerchantaccount.com, as a new DNS server, on the same machine as my webserver - A windows 2003 box. This is what I did.

Started the DNS server service (Services> DNS Server > Right click properties > Automatic > start). Start > Run > DNSMgmt.msc > Refresh.

Click on Forward lookup zone > Primary Zone.

Now add Three NS records, for Ns3.openmerchantaccount.com, Ns4.openmerchantaccount.com, and Ns5.openmerchantaccount.com. And an Three A records, one for @, * and www, the * being my preference.

Importantly, go to the registrar of your domain and enter the three Nameservers as above.

Now, to test this, I waited until the NS records had delegated from the registrar, by checking

NSLookup -q=ns freesms.org.il during the day until all three nameservers appeared.

I then momentarilly stopped the two other nameservers, NS3 and Ns4 using

rndc stop

After the cache timeout period of about a minute, I tried pinging domains on the ne NS3/NS4 nameservers, and as expected, they failed to return.

But happily, the domain with the third nameserver did respond!

So I restarted the DNS server again by using named in /etc/init.d.

No comments: