DNS hierarchy and resolution
DNS turns names into useful records
DNS is a distributed naming system, not a single address book. A browser can ask for the IP address of a named host; a mail server can ask which server receives mail for a domain. A stub resolver is the client-side component that asks a recursive resolver to obtain an answer. That resolver may already have the result in its cache (temporary storage). Otherwise it follows delegations to servers responsible for the requested name. DNS resolution alone does not establish a connection to the destination application. All names and addresses below are fictional documentation fixtures, not the live contents of example.com.
Read the name from right to left
The final dot in www.example.com. represents the root. Below it is the top-level domain com, then example.com, then the label www. A zone is an administrative portion of the DNS tree; it need not include all descendants if a child is delegated to another zone. Parent NS records identify the child zone’s name servers. Where necessary the parent also supplies glue address records so a resolver can reach an in-domain name server without a circular lookup. An authoritative server answers from data for zones it serves. A recursive server obtains answers for clients; these are roles, and software can implement both.
Follow one cold-cache lookup
Assume no relevant cache entries and a simplified hierarchy. The stub requests recursion (RD); the resolver follows referrals until it gets a record. RA means recursion is available; AA indicates an authoritative answer in the applicable response. This diagram omits retries, glue details, DNSSEC validation and query-name minimization; a real resolver may ask only for the necessary labels at each delegation.
Stub -> Recursive: www.example.com. A (RD=1)Recursive -> Root: referral to com.Recursive -> com. server: referral to example.com.Recursive -> example.com. authority: A 192.0.2.20 (AA=1)Recursive -> Stub: A 192.0.2.20 (RA=1, AA=0)How the query travels
Classic DNS uses UDP or TCP port 53. UDP is common for small queries, but TCP is not reserved for zone transfers; general-purpose DNS implementations support both. A UDP reply with TC=1 indicates truncation and normally leads to a TCP retry. EDNS(0) extends DNS using an OPT pseudo-record, including an advertised UDP payload size; it does not guarantee that a packet of that size traverses the path. Query ID, question, flags, and answer/authority/additional sections help interpret a message. The resolver can forward to another recursive service instead of iterating itself.
Predict the next step
If the resolver has an unexpired answer for the requested name and type, it can usually answer without contacting the hierarchy again. If it has only a usable referral for example.com, it can start there instead of the root. Draw the two paths and mark which component is responsible for caching. Do not equate RD=1 with proof of a successful lookup. Baseline reading: RFC 1034, RFC 9499, RFC 7766 and RFC 6891. Next: records and caching.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
DNS hierarchy and resolution — knowledge check
Apply DNS concepts to synthetic records and recorded scenarios.
A laptop wants an address for a host. Which component normally asks a recursive service?
A resolver receives an unexpired usable referral for example.com. Where can it start a fresh lookup for www.example.com?
Why may a parent zone provide glue addresses?
A UDP DNS response has TC=1. What is the normal next step?
A DNS response has RA=1. What does that indicate?