6

Like I have for my domain:

ns1.somedomain.com 
IP: 122.some.ip.here

ns2.somedomain.com 
IP: 122.some.ip.here

Why there are 2 or more of them? The hosting is just one server and if that falls neither one will work. True?

8 Answers 8

14

As others have commented, there are multiple nameservers for redundancy purposes.

If you have a single DNS server and it goes down, all your services go down with it regardless (er, whichever services rely on IP name resolution at least). If you have multiple name servers then when one fails the other(s) will take over or at least be reachable.

Without going into the topic of dns caching... In general, domains utilize multiple servers which typically segregate services. Most likely you actually have multiple servers hosting different services in your domain. It's likely your mail services are running on different servers than your web services, for example. So, then, when your web server goes down your mail is likely to continue to flow. If you had a single dns server and it was also down then you would not receive mail, even though your mail server is still up. Having multiple dns servers solves this case.

Also, you'll want those multiple DNS servers on different IP subnets so that when a router goes down or something similar your name resolution won't go down with it. This happened to Microsoft a while back.

1
  • 1
    it happened to serverfault.com too, although in this case it broke even though the two name servers were in different subnets. The problem was that all queries still went via the same router.
    – Alnitak
    Jul 31, 2009 at 10:25
4

A nameserver is there to resolve a hostname to an IP address. You need two nameservers, as if one goes down then your host is inaccessible via name

You're right though, this doesn't alter the fact that if you only have one host and it's down, then it doesn't matter how many nameservers you have - The host will still be inaccessible via name

4
  • 1
    Actually, it does matter in some circumstances. For instance, some mail servers will see a failed DNS lookup as a permanent error where they would see a failed connection after successful name->ip lookup as a transient one (meaning delivery will be reattempted later). Jul 30, 2009 at 16:33
  • I've only ever seen "Temporary lookup failure", in which case the SMTP server will retry at whatever interval is configured. Out of interest, what SMTP servers don't act in this manner? The RFC (ietf.org/rfc/rfc1893.txt) would imply that a 4xx code should be returned, rather than a 5xx
    – Ben Quick
    Jul 30, 2009 at 16:58
  • RFC 1893 was obsoleted by RFC 3463 in January 2003, and has been updated by five subsequent RFCs
    – Alnitak
    Jul 31, 2009 at 14:44
  • Yep, I can see that. Having a brief look through the updates, I can't see anything that states that a lack of a nameserver for a domain should result in a 5xx rather than a 4xx Could you point me in the right direction as to where it's stated a 5xx should be returned? And, what SMTP server implements this. As I previously said, I've only ever seen 4xx responses from that scenario
    – Ben Quick
    Aug 1, 2009 at 15:54
4

You're right in that if you lose your primary DNS/Webserver and they're on the same box, it doesn't matter too much as far as your web hosting goes. There is still one very good reason to have redundant DNS and that's for email.

When a remote server attempts to send mail to your domain, it'll perform a lookup to find the MX records. If it can see them (because your secondary is up) but cant contact them, that mail will be queued. When your Web/DNS/Mail server comes back online, eventually the remote server will try redelivery and the message will come through.

If on the other hand you have no secondary DNS servers, when the remote end goes to lookup your domain and it's offline, it sees nothing. In that case, instead of queuing the email, it will bounce. Arguably if your domain has no mail service that's not a problem. In my experience DNS can be more fragile than other services though so the more redundancy you have the better.

2

Correct, if you have only one server, it doesn't matter that much. But normally, you'll have multiple servers on different DNS records.

For this reason it's important not to have a single point of failure in DNS.

2

The recommended setup is to have at least two DNS servers and it is recommended that at least one is hosted on a separate network to protect you from a network outage. You can use a single DNS server for hosting a domain, but it's definitely not recommended. If your ISP configured your domain with a single DNS server, then this would suggest either a lack of technical clue or a tendency to skimp on services.

The probably reason why you have two different names with the same IP address is that domain registrations generally require two different DNS servers to be listed.

2

The name server is separate from your actual server (at least it should be), so even if you have a single point of failure with your server, you'll want redundancy at the NS layer. Yes if you main server goes down you're offline, but multiple name servers will protect you from one of those being unavailable.

In some settings name servers also get quite busy and don't answer quickly, so DNS clients may fail over to a secondary server just from load.

2

Apart from resilience, multiple nameservers can provide

latency reduction (e.g. where the nameservers are, for example, on different continents) and

many domain registries require that a domain name has more than one authoritative nameserver. Two is a minimum for registration and this should be maintained subsequently. Many domains and registrars will use more. A typical maximum is 13.

1

Well, there might be more than one server in a domain, and often, the NS will host more than one domain, so if if fails, many servers are affected. And since the NS is run by your ISP, why bother?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .