Understanding The DNS Lookup Process

We will understand how DNS lookup works by looking at an example. In this example, all the interactions -except for the root name server- are assumed to be recursive, although some may argue that all queries should be iterative.

how-domain-name-system-works
Figure: how DNS works © Computer Networking: A Top Down Approach
  1. “Surf.eurocom.fr” needs to communicate with “gaia.cs.umass.edu”. We don’t know whether it is a HTTP communication, an FTP transfer or an email service. Either way, there must be a DNS name resolution. So “Surf.eurocom.fr” DNS client, the resolver, sends a DNS request to its local DNS name server, “dns.eurocom.fr”. The request litterally contains the name “gaia.cs.umass.edu”.
  2. “dns.eurocom.fr” looks up “gaia.cs.umass.edu” into its DNS database. It does not find any entry. So it requests it on behalf of “Surf.eurocom.fr” to the root name server.
  3. the root name server does not know how to resolve this domain name; it responds with the IP address of an intermediate name server that can help with the request. The intermediate name server host name is “dns.umass.edu”
  4. the local name server requests the intermediate name server “dns.umass.edu”
  5. on behalf of the local name server, the intermediate name server queries an authoritative name server, “dns.cs.umass.edu”
  6. the authoritative name server has the needed mapping and replies with the IP address of the host “gaia”
  7. the intermediate name server transfers the reply back to the local name server,
  8. the local name server transfers the reply back to the requesting host.
  9. the requesting host installs the DNS response in its DNS cache

Recursive queries vs iterative queries in the DNS lookup process

A DNS query is said recursive when a host A (it could be a name server too) sends a DNS query to a name server B that will fetch the mapping on behalf of A.

A DNS query is said iterative (or non recursive) when a host A (it could be a name server too) sends a DNS request to a name server B, which immediately responds with a reply.

As we saw above, we assumed that a DNS request follows a chain of queries from one server to another. Let’s call it query chain.

In a query chain, often all DNS requests are recursive, except requests between local name servers and root name servers. Root name servers reply with NS records and A records which contain IP addresses of authoritative name servers (see Glue records) and not the final mapped IP address. That’s because root name servers must not be burdened with such “basic” tasks.

Sometimes DNS requests in the query chain are iterative. Each time the DNS resolver requests name servers -whether they are root name servers or others-, it receives responses and caches them in its DNS cache.

non-recursive-query
Figure: non-recursive queries © Stanford University

But how can the DNS resolver contact the root name server? Is it true that it needs a name resolution to get the IP address of the root name server? In an article on IANA website, it is indicated that client DNS applications implement the IP addresses and names of root name servers in file called root hints file.

Comments

Popular posts from this blog

The Thing With CUCM Device Packs

En Bloc Dialing vs Digit-By-Digit Dialing

Call Forward And Call Hunt on CUCM