DNS basics — how recursive resolvers and authoritative servers work together
DNS is the address book of the internet. This article walks through the journey of a single query — from your laptop typing example.com in the browser, to the IP that ships back milliseconds later. It is aimed at developers, IT generalists and security folks who want a working mental model without diving into the wire format yet.
What DNS actually is
The Domain Name System is a globally distributed lookup service that maps human-readable names (secdns.app) to records the network stack can act on — typically A (IPv4) or AAAA (IPv6) addresses, but also MX (mail servers), TXT, CAA, SRV and many more. RFC 1034 describes the conceptual model and RFC 1035 specifies the wire format.
DNS is hierarchical. The empty root (.) delegates to top-level domains (com., org., uk.), which in turn delegate to second-level domains (example.com), and so on. Each level is authoritative for the records directly below it, and each delegation is implemented with NS records pointing at the next nameserver.
"The domain name space is a tree structure. Each node and leaf on the tree corresponds to a resource set." — RFC 1034 §3.1
Recursive vs authoritative servers
Two very different roles share the name "DNS server":
| Role | What it does | Examples |
|---|---|---|
| Recursive resolver | Accepts queries from clients and walks the hierarchy on their behalf | Your ISP resolver, 1.1.1.1, SecDNS |
| Authoritative server | Holds the actual zone data and answers only for the names it owns | Route 53, NS1, your own BIND server |
Clients (laptops, phones, IoT gear) only talk to recursive resolvers. The resolver does the legwork of finding the authoritative server for a name and caching the result so the next lookup is fast.
The query lifecycle
When your browser asks the OS to resolve www.example.com, the following usually happens:
- The stub resolver on the OS forwards the query to the configured recursive resolver — over UDP/53, TCP/53 or an encrypted transport like DoH or DoT.
- The recursive resolver checks its cache. On a hit it answers immediately.
- On a miss, it queries a root server (
a.root-servers.net.throughm.root-servers.net.) forcom.NS records. - It then queries the
com.TLD nameserver forexample.com.NS records. - Finally it queries one of
example.com.'s authoritative servers forwww.example.com. A?. - The answer (plus TTL) is cached and returned to the stub.
You can reproduce the walk with dig:
dig +trace www.example.com
Each hop is bounded by a TTL — a hint from the zone owner telling resolvers how long they may cache the record. Short TTLs make changes propagate fast but increase load on the authoritative servers.
What the resolver actually sees
Beyond the answer record, the resolver collects several signals on each query: response code (NOERROR, NXDOMAIN, SERVFAIL), DNSSEC validation state (see DNSSEC explained), EDNS options, response size and round-trip timing. Protective DNS products like SecDNS combine those signals with threat-intel lookups to decide whether to answer truthfully or block the query — covered in What is protective DNS?.
Further reading
- Glossary: DNS, DoH, DoT, DNSSEC
- Features: DNS over HTTPS, DNS over TLS, DNSSEC validation
- Learn: How DNS works in depth, DoH vs DoT, How DNS attacks work