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?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
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.
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
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.
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.
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.
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.