DNS Resolution: Recursive Queries and Records
The Domain Name System maps names to data through a distributed hierarchy. A client’s lookup may involve a recursive resolver, cached answers and several authoritative servers.
Updated · Editorial approach and simulation limits
Stub resolver, recursive resolver and authoritative server
An application usually asks a local stub resolver for a name. The stub sends the question to a recursive resolver, which can answer from cache or query the DNS hierarchy. If needed, the resolver follows referrals from root to top-level-domain and authoritative servers until it can return an answer.
A recursive query asks the receiving resolver to do the work for the client; an iterative response can refer the requester to another server. A packet capture at the laptop may show only the stub-to-recursive exchange, not the resolver’s upstream queries.
Records answer different questions
A, AAAA and CNAME records describe common IPv4, IPv6 and alias data. MX identifies mail exchangers, NS delegates authority, and TXT carries data used by many applications. The record type tells you what kind of answer was requested; it does not guarantee that the returned address accepts a connection.
DNS messages contain a question and sections for answers, authority and additional data. The response code and flags matter: NXDOMAIN means the queried name does not exist according to that server’s view, while NOERROR can still return no requested record. Read the question and answer together.
Caching, transport and secure DNS are separate concerns
A resource record’s TTL limits how long a cache should reuse that data. Different resolvers may return different answers because of cache state, split-horizon policy, filtering, geographic steering or a different view of the DNS hierarchy. A stale-looking answer should be compared with the authoritative data and the resolver used by the client.
Traditional DNS commonly uses UDP and can also use TCP. DNS over HTTPS or DNS over TLS encrypts the client-to-resolver transport, while DNSSEC provides validation for signed DNS data. These mechanisms answer different questions and can be combined; encrypted transport alone does not prove answer authenticity.
Explore DNS interactively
Follow the matching exchange packet by packet. The animation is a scripted teaching model with illustrative timing, not a capture of your network.
Specification and source
For exact protocol requirements, consult the primary document: RFC 1035: Domain Names — Implementation and Specification. This page summarizes selected behavior and is not a substitute for the specification.
Related protocol lessons
Browse all network protocols · Compare encrypted DNS and DNSSEC