-
Domain name pointing to 2 different DNS servers
Posted on May 30th, 2009 No commentsHello guys,
When you register a domain name, let´s say at GODADDY.com and they ask you for the DNS servers, if one of the servers is down, the other DNS server is supposed to serve in order to browse the website?
Let’s say I have DNS1 and DNS2, when a user try to browse my site, it will always point to DNS1 and if this one is down, it will automatically point to DNS2?
Thanks!
It’s not as simple as that I’m afraid.
You must split up DNS and HTTP. They operate on very different levels, DNS couldn’t care less about HTTP and vice versa.
I think what you’re looking for is Fail-Over should one of the web servers fail? You can use DNS to provide that, but it’s not quite that simple, and gets more complex if the DNS service and web service share a server.
Normally you would have:
DNS1 (1.2.3.4) - Primary for domain.com
www.domain.com IN A 1.2.3.4 TTL 300 (5 minutes)DNS2 (1.2.3.5) - Primary for domain.com
www.domain.com IN A 1.2.3.4 TTL 300 (5 minutes)Note that both DNS servers are Primary, that means no automatic replication of changes between the zones. If we don’t make both Primary you’re pretty stuffed if you lose the Primary DNS Server, you won’t be able to make changes (Secondary zones are Read Only).
Also notice that we have a low TTL set, 5 minutes. The TTL or Time To Live defines how long a requesting DNS server should remember your record before asking for it again.
If the web service on 1.2.3.4 fails you would have to manually change the IP address for www.domain.com and point it to 1.2.3.5. Clients would continue to go to 1.2.3.4 until you do.
You could do this:
DNS1 (1.2.3.4) - Primary for domain.com
www.domain.com IN A 1.2.3.4 TTL 300 (5 minutes)DNS2 (1.2.3.5) - Primary for domain.com
www.domain.com IN A 1.2.3.5 TTL 300 (5 minutes)In this situation while both servers are up load will be roughly split between the servers. It’s very rough because you cannot control who queries DNS1 and who queries DNS2 while both are available.
If DNS1 were to fail it should drop off and only DNS2 would be responding, and therefore only DNS2 would be used as a Web Server (because that’s the only version of the www record available). We’re still reliant on the low TTL or 1.2.3.4 will be used if it’s in memory / in the cache.
In short, while both are up you will not be able to control which web server is used unless you only have one www record.




Recent Comments