How DNS works

Follow a DNS lookup

Trace the referral path from the root through a top-level domain to the authoritative server for the requested name.

8 minute lesson

~~~

Suppose a resolver needs the address for www.example.com and has nothing cached.

Your laptop does not usually perform the complete search. Its stub resolver asks a recursive resolver, which does the work and returns the final answer.

With an empty cache, the recursive resolver follows referrals:

  1. A root server points it to nameservers for the com top-level domain.
  2. A com nameserver points it to nameservers authoritative for example.com.
  3. An example.com nameserver returns the record for www.example.com.

The root does not store every website address. It knows where to continue. The com server also delegates rather than answering for every .com hostname. Each level is responsible for its portion of the namespace.

A referral contains NS records. It can also include glue address records needed to reach a delegated nameserver whose own name is inside the delegated zone. Glue helps the lookup continue; it is not the final website answer.

If www.example.com is a CNAME, the resolver must also resolve the CNAME target. The final authoritative DNS server is not necessarily the web server—authority describes who publishes the DNS data.

You can observe an iterative path with:

dig +trace www.example.com A

+trace makes dig follow the chain itself instead of asking your normal recursive resolver to return the completed answer.

Your action is to trace one hostname. Identify the root referral, the top-level-domain referral, the authoritative nameserver, and the final answer or alias.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →