1

For most hosting providers, including cloud hosting, you are given a couple name servers like ns1.hostingprovider.domain and ns2.hostingprovider.domain, which you use for all your domains.

On AWS, for each domain (each hosted zone), you get a bunch of different name servers. Why does it happen? Does it mean that for other hosting providers, all their domains are in the same hosted zone? Should we keep all our domains in the same hosted zone (not sure if this is possible at all).

What I mean is not why we have 4 nameservers instead of 2 but why the nameservers are different for each domain. For example, if I have domains test1.domain and test2.domain, to add them to some hosting provider, I will add nameservers ns1.hostingprovider.domain and ns2.hostingprovider.domain to both domains. But for AWS I will add something like ns-325.awsdns-35.net and ns-2421.awsdns-58.co.uk for one domain and ns-224.awsdns-59.co.uk and ns-147.awsdns-44.org for the other domain. Hope, this makes sense.

Igor Skoldin
  • 123
  • 1
  • 6

1 Answers1

2

Multiple name servers are used for maintaining high redundancy and avoiding downtime. Let me explain this in a simple way.

Name Servers are used for serving the zone file, and zone file is a file which contains all the records for a specific domain.

Example of Zone file

;name     ttl   class rr     value 
server01  30m   IN    A      192.168.0.3
server02  30m   IN    A      192.168.0.4

webmail   24h   IN    CNAME  server01
extranet  24h   IN    CNAME  server02
ftp       24h   IN    CNAME  server02
For most hosting providers, including cloud hosting, you are given a couple name servers like ns1.hostingprovider.domain and ns2.hostingprovider.domain, which you use for all your domains.

As in above case, most hosting providers are using multiple name servers because, if the primary server lets say ns1.hostingprovider.domain hosting the client's DNS Zone goes down due to any circumstances, all the requests for above DNS Zone should start redirecting to secondary name server i.e ns2.hostingprovider.domain

Most of the hosting companies provide you two name servers but if you resolve the host-name provided by them to Ip address, For example if you resolve ns1.hostingprovider.domain and ns2.hostingprovider.domain and find their A record Check A record, then you will see that it is resolving to same IP address, which means they are providing you two different name servers but they are not hosted on two different servers/locations which means they are not redundant and your whole application can come down by just bringing this server down. This is trick followed by many of hosting organizations.

On AWS, for each domain (each hosted zone), you get a bunch of different name servers. Why does it happen?

AWS, Uses 4 different name servers in different zones to provide the high redundancy and uptime to your domain. Hope this clears your doubt.

imvikasmunjal
  • 753
  • 7
  • 14
  • Thanks for this explanation but what I meant is rather not why we have 4 nameservers instead of 2 but why the nameservers are different for each domain. For example, if I have domains test1.domain and test2.domain, to add them to some hosting provider, I will add nameservers ns1.hostingprovider.domain and ns2.hostingprovider.domain to both domains. But for AWS I will add something like ns-325.awsdns-35.net and ns-2421.awsdns-58.co.uk for one domain and ns-224.awsdns-59.co.uk and ns-147.awsdns-44.org for the other domain. Hope, this makes sense. – Igor Skoldin Sep 19 '17 at 11:55