Mobile app version of vmapp.org
Login or Join
Yeniel560

: How do the authorative domain name servers know which IP to point to? This is a question that has been bugging me for a good 20 years. I could just never really get my head around it. enlighten

@Yeniel560

Posted in: #Dns #DnsServers #Domains #Nameserver #Webserver

This is a question that has been bugging me for a good 20 years. I could just never really get my head around it. enlighten me, please.

I best explain with an example:

I have a domain set with the authorative domain name servers ns1.godaddy.com, ns2.godaddy.com and ns3.godaddy.com. Thousands of people have these exact same nameservers set for their domains.

So now I go ahead and get myself a webserver and create a new webspace for my domain. I set those nameservers from before. Now magically it all works.

but how on earth does the DNS know that my webserver is the legitimate one to point to? For all I know there could have been dozens of other people creating a webspace and entering my domain name before me.

To me it would make sense if I would have had to tie the IP address of my webserver to the nameservers on the level of the domain, but nope, was never asked to.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Yeniel560

1 Comments

Sorted by latest first Latest Oldest Best

 

@Jessie594

It gets kind of complicated and @closetnoc does a good job of simplifying the process but I will try to expand it into detail here. For the purpose of this example I will use the following givens...

Domain: domain.com
Registrar: GoDaddy
Web Server: gator15.hostgator.com

When you register a domain name you do this through a domain registrar who acts as a seller domain names on behalf of the root domains register (Verisign for .com domains). Once this has happened your registration information, while having been done through GoDaddy, is actually held both by GoDaddy as well as by Verisign.

Now you choose a DNS provider. Now most registrars provide DNS hosting as part of their services or you can choose to go with a separate provider. In this example I will say that the DNS is being provided by AWS. You set up a new DNS service through AWS for hosting your DNS records. At the top of the zone information will be the SOA record (statement of authority). This record states the DNS servers which are the authoratative name servers for your domain name. These also happen to be the name servers you give to your registrar to go down as your name servers for your domain name.

So far what we have done is created a new domain name and configured it to point to the DNS host we want so we can configure out DNS settings, but now we want to point it to our web server. We have already created a web hosting service with HostGator on server gator15.hostgator.com and it has been configured to respond to both example.com as well as example.com. We go into our DNS hosts admin panel (AWS) and create a new A record named example.com. and point it to the IP address we have been given by HostGator. We create a new CNAME record name www and point to example.com.

At this point we have done everything that needs to be done from registering a domain to pointing it to our website and getting it all working.

What you mention in your post about dozens of people creating their own web space with your domain name is true, anyone can as there is no restriction on what you name a web space when setting up a site but the fact is no one will be able to access it. In order to get to the web server it first has to go through checking the name servers for the domain at the registrar, then connect to the name servers and check what IP address is associated with the DNS address requested, then direct the browser to that IP address. It is a fairly safe assumption that if someone has been able to change the DNS zone file or the name server settings (not taking into account hacking those providers) then they have the authority to say where the web site is hosted and state that a particular server is the server that should be running the site.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme