How are DNS records updated to all DNS servers on the internet?

Solution 1:

They don't. (Simplifying just a little bit) DNS is a hierarchy. DNS servers know either how to find a parent DNS server or how to find a list of the "root" servers.

If they find a parent DNS server they just ask it, and it asks its parent until it gets an authoritative answer.

In most cases however, nameservers know the root nameservers, which in turn point them to the appropriate servers for the domain. (Or in some cases the appropriate server for the first part of the domain. This process is repeated until the domain name is resolved).

Below is an example of a "trace" which shows how the system could authoritatively resolve an IP address for www.google.com (ignoring signatures):

Cut down output from Linux command "dig +trace www.google.com"

; <<>> DiG 9.11.3-1ubuntu1.11-Ubuntu <<>> +trace www.google.com
;; global options: +cmd
.           514683  IN  NS  a.root-servers.net.
.           514683  IN  NS  b.root-servers.net.
.           514683  IN  NS  c.root-servers.net.
.           514683  IN  NS  d.root-servers.net.
.           514683  IN  NS  e.root-servers.net.
.           514683  IN  NS  f.root-servers.net.
.           514683  IN  NS  g.root-servers.net.
.           514683  IN  NS  h.root-servers.net.
.           514683  IN  NS  i.root-servers.net.
.           514683  IN  NS  j.root-servers.net.
.           514683  IN  NS  k.root-servers.net.
.           514683  IN  NS  l.root-servers.net.
.           514683  IN  NS  m.root-servers.net.
;; Received 525 bytes from 10.0.3.254#53(10.0.3.254) in 13 ms

com.            172800  IN  NS  i.gtld-servers.net.
com.            172800  IN  NS  k.gtld-servers.net.
com.            172800  IN  NS  a.gtld-servers.net.
com.            172800  IN  NS  e.gtld-servers.net.
com.            172800  IN  NS  h.gtld-servers.net.
com.            172800  IN  NS  j.gtld-servers.net.
com.            172800  IN  NS  l.gtld-servers.net.
com.            172800  IN  NS  m.gtld-servers.net.
com.            172800  IN  NS  c.gtld-servers.net.
com.            172800  IN  NS  b.gtld-servers.net.
com.            172800  IN  NS  f.gtld-servers.net.
com.            172800  IN  NS  g.gtld-servers.net.
com.            172800  IN  NS  d.gtld-servers.net.


google.com.     172800  IN  NS  ns2.google.com.
google.com.     172800  IN  NS  ns1.google.com.
google.com.     172800  IN  NS  ns3.google.com.
google.com.     172800  IN  NS  ns4.google.com.
;; Received 840 bytes from 192.33.14.30#53(b.gtld-servers.net) in 35 ms

www.google.com.     300 IN  A   172.217.25.36
;; Received 59 bytes from 216.239.36.10#53(ns3.google.com) in 178 ms
  1. The first query looks up the root servers (*.root-servers.net)
  2. Then the root servers advise where to find the rightmost part of the domain - ".com"
  3. The third query returns the nameservers for google.com
  4. Finally Google's nameservers advise the answer for www.google.com

I note in the example above I've manually stripped the query result to its bare essentials. In reality a nameserver won't generally make all of these queries, because it will remember parts of it. That is, the first time someone looks up any .com domain name, the DNS server they are using will remember the nameservers (for 172800 seconds in this case), so it won't need to do another lookup. Similarly for all the more specific parts of the lookup.

So if someone is registering example.com via GoDaddy (or any registrar), GoDaddy needs to (programmatically) get the nameservers for example.com entered into the ".com" nameserver. Similarly, if they are in AU, they need to enter the information into the ".com.au" space if they want to register "example.com.au" - and this would require an agreement with the people controlling the nameservers for ".com.au" space - which is why not all registrars can register all domains, and why getting new top level domains is such a process - they need to pay big money to register the TLD with the root nameservers.