DNS and NameServer

Sanjeev Pandey

Sanjeev Pandey ·

Most of the time You won’t find any difference between the Both because they are used interchangeably in IT industry but still there is small difference the way we use both of them in real world.

DNS

Stands for Domain Name Service/Server which basically resolves name to ip. So whenever as a client we go to “Google.com” in our browser so the first thing which happens is, that request goes to DNS server first to get the mapped A or CNAME record for that particular name and then will recreate the http packet to talk to the ip which was given by DNS.

Here is a picture to illustrate dns process

DNS process — how a name is resolved to an IP

(won’t get into that stuff like how do we get the dns ip to query at first place)

Name Server

Is a dns record type itself which is abbreviated by NS which stands for “Name Server”, is basically the server which is responsible to store all the records of a particular domain.

Little confusion here right.

Name Server — little confusion

Let me give you a real world example here.

Assuming that everybody is aware about Go-daddy and Route53, they both are the dns provider and Name Server provider as well.

Suppose I am starting an e-commerce company, for that i will need to have a domain name which can be accessed globally so we will go to the Domain Registrar which happens to be Go-daddy in our case and will register our domain name if available, let’s say “xyz.com” in this scenario.

So being a registrar it is Go-daddy’s responsibility to give us the dns services so that if anybody queries about xyz.com, that should get resolved by Go-daddy’s dns server.

So everything is going good so far, we have got all our corresponding records served by Go-daddy’s dns server itself. Somewhere down the the line somebody suggests in our team that we should use Route53 as our dns service instead of Go-daddy as Route53 service is globally available (have got better availability then Do-daddy has).

Since Go-daddy is our domain registrar, we have got two options here with us, Either we will have to migrate our domain to AWS Route53 which might take about 90 days, (process of changing domain registrar itself).

We can’t wait that longer and need to use Route53 as soon as possible so we cannot go with the first option Or the second option we have Here with us is which is a concept of Name Server, in which we can go to Route53 service and can create hosted-zone named “xyz.com”, the same name which we purchased from Go-daddy itself earlier, (remember we are just creating a zone, not purchasing the domain name so please don’t get confused here ).

Once we create the hosted-name, we will have automated NS record created for us, which would look like.

Route53 hosted zone — NS records for the domain

We are not done yet, because creating a hosted-zone in Route53 doesn’t make our domain name available globally. (this is important to understand here).

If you remember Go-daddy is still our domain-registrar which holds all the records for xyz.com.

Now since we have got the Name-Server records for “xyz.com” from Route53, we will have go to our dns settings in our Godaddy’s account and then we will go to the Name-Server section where you can see 2 or 3 Name Server entries like shown below -

GoDaddy — Name Server section in DNS settings

Now we need to edit these servers with the Name Server we got from Route53 (you can look at the picture above), after we save our settings, our name server setting should look like.

ns1.aws.com ns2.aws.com ns3.aws.com ns4.aws.com

Now what will happen is, every time if anybody queries about “xyz.com” records, the request will go to Go-daddy first (our registrar off course), it will look into it’s record and will find out that it may be the registrar but there are couple of entries in name server for which it’s not responsible for, so Go-daddy will return those Name Server’s address (saying, i am not handling any records (other then NS record)

But wait i have got Name Server which claims to have all records corresponding to this “xyz.com”, so you go and ask them). So this is how queries get resolved finally from Name Server.

So this is the basic difference between dns and Name-Server, I wanted to explain everything within 10 lines at first but it wouldn’t have made sense if I had not taken a real world scenario here.

Till the next time — Happy learning :)