TechnologyNetworking

How DNS resolution works, step by step

A complete walkthrough of DNS resolution: the recursive resolver, root, TLD and authoritative servers, caching layers, TTL behaviour, and why DNS is so often the hidden cause of slow first loads.

MAMichael Adeyemi — Senior Technology Writer, MSc, Distributed SystemsPublished 4 March 2026Last reviewed 15 July 202611 min readFoundational2,167 words

Fact-checked by Dr. Rina Halvorsen, Editor-in-Chief (PhD, Cognitive Science) · 4 primary sources cited · how we review

Illustration of a network of nodes resolving a hostname into an address across hierarchical layers

In short

DNS resolution turns a hostname into an IP address by walking a hierarchy — root, top-level domain, authoritative server — through a recursive resolver that caches answers according to each record's TTL. Most lookups never leave the cache, but the ones that do can add hundreds of milliseconds before a single byte of your page is requested.

Every page load begins with a question the browser cannot answer on its own: which machine should receive this request? The Domain Name System exists to answer that question, and it does so through a distributed hierarchy that has stayed fundamentally unchanged since the 1980s while growing to handle trillions of daily queries.

The four participants

A full resolution involves four distinct roles. The stub resolver lives in your operating system and does almost nothing except forward the question. The recursive resolver — run by your network provider or a public service — does the actual legwork and holds the cache that most lookups are served from. The root and top-level domain servers do not know the answer but know who does. The authoritative name server holds the real records for the domain and returns the final answer.

Roles in a DNS lookup
ParticipantKnowsReturns
Stub resolverWhich recursive resolver to askForwards the query
Recursive resolverCached answers and how to walk the hierarchyThe final address to the client
Root serverWhich servers handle each top-level domainA referral to the TLD
TLD serverWhich name servers are authoritative for a domainA referral to the authoritative server
Authoritative serverThe actual records for the zoneThe authoritative answer

A cold lookup, step by step

  1. The browser checks its own in-process cache, then asks the operating system stub resolver.
  2. The stub resolver forwards the query to the configured recursive resolver.
  3. With nothing cached, the recursive resolver queries a root server, which refers it to the servers responsible for the relevant top-level domain.
  4. The resolver queries a TLD server, which refers it to the authoritative name servers listed for the domain.
  5. The resolver queries an authoritative server, which returns the address record.
  6. The resolver caches the answer for the duration of its TTL and returns it to the client, which can finally open a connection.

That is up to four sequential round trips before any content is requested. On a well-connected desktop each hop might cost 20 milliseconds; on a high-latency mobile connection the same sequence can exceed 400 milliseconds. This is why DNS shows up inside time to first byte and, indirectly, inside Largest Contentful Paint.

Record types you will actually meet

Common DNS record types
TypePurposeTypical use
AMaps a hostname to an IPv4 addressPointing a domain at a server or load balancer
AAAAMaps a hostname to an IPv6 addressDual-stack hosting
CNAMEAliases one hostname to anotherPointing a subdomain at a managed platform
MXNames the mail servers for a domainEmail delivery routing
TXTHolds arbitrary textDomain verification, SPF and DKIM policy
NSDelegates a zone to name serversHanding a subdomain to another provider

One constraint catches people out repeatedly: a CNAME cannot coexist with other records at the same name, which is why a bare apex domain usually cannot be a CNAME. Providers work around this with proprietary flattening — ALIAS or ANAME records — that resolve the target server-side and answer with an A record.

TTL: the trade-off nobody tunes

Every record carries a time to live, the number of seconds a resolver may reuse the cached answer. TTL is a straight trade between speed and agility. Long TTLs mean more cache hits, fewer authoritative queries and faster average lookups; they also mean a change takes that long to reach everyone.

Cache hit ratio at a busy recursive resolver by record TTL

% queries served from cache

Modelled from queueing assumptions at a resolver seeing steady query volume for a popular hostname; illustrates the shape of the relationship rather than a measured dataset.

The standard operational pattern is to lower the TTL to 60–300 seconds a day or two before a planned migration, perform the change, confirm propagation, then raise it back. Note that resolvers are permitted to ignore very low TTLs, and some enforce their own floor, so a short TTL is a request rather than a guarantee.

Encrypted DNS and where it changes things

Classic DNS travels in plaintext over UDP port 53, visible to anyone on the path. DNS over TLS and DNS over HTTPS wrap the same queries in an encrypted channel to the resolver. Both protect the query in transit and prevent trivial on-path tampering; neither hides the destination from the resolver itself, and the subsequent connection still reveals the destination address.

Using a public encrypted resolver

Pros

  • Query contents are not readable by others on the local network.
  • Public resolvers often have large caches and wide server footprints, reducing cold-lookup latency.
  • Harder for intermediaries to inject or redirect answers.
  • Consistent behaviour across networks, useful when travelling.

Cons

  • You transfer visibility of your full browsing pattern to the resolver operator.
  • Bypasses local network policy, including some parental and enterprise controls.
  • Geographic answers can be less accurate, occasionally routing you to a distant CDN node.
  • Troubleshooting is harder when the resolver is outside your control.

When DNS is the actual problem

DNSSEC and answer integrity

Everything described so far assumes the answers coming back through the hierarchy are honest. Classic DNS has no way to verify that, which leaves it open to cache poisoning: an attacker who can guess or intercept a query's transaction details can inject a forged answer that a resolver will happily cache and serve to every subsequent client. DNS Security Extensions address this by attaching a cryptographic signature to each zone's records, generated with a private key held by the zone's operator and verifiable with a public key published in the parent zone.

A validating resolver follows this chain of trust upward from the record it received to the root, checking each signature along the way. If any link fails to verify, the resolver returns an error rather than the unverified answer, even if that answer would otherwise have looked plausible. This closes the specific hole that made cache poisoning practical, though it does not encrypt anything — DNSSEC is about authenticity, not confidentiality, which is why it is complementary to, rather than a substitute for, DNS over TLS or DNS over HTTPS.

Adoption has been slower than the specification's age would suggest, partly because a misconfigured signature can take a zone offline rather than degrading gracefully. Even so, most large top-level domains now sign their records, and major public resolvers validate signatures by default.

Anycast: one address, many locations

Large-scale DNS infrastructure, including the root servers and most major public resolvers, is not a single machine but the same IP address announced from dozens or hundreds of physical sites using a routing technique called anycast. Internet routing naturally directs a query to whichever announcing site is topologically closest to the sender, so two people on different continents querying the same address are actually answered by two different, nearby servers without either of them configuring anything differently.

This matters for both speed and resilience: it shortens the physical distance a query travels, and the loss of any single site is invisible to users since traffic is simply routed to the next-nearest announcing location.

  • A large gap between navigation start and connection start in a waterfall points squarely at resolution time.
  • Intermittent failures affecting only some users usually mean inconsistent records across authoritative servers.
  • Changes that 'work for me' but not for others are almost always TTL propagation, not a broken record.
  • Slow first loads on mobile with fast repeat loads suggest a cold lookup on a high-latency link.

For third-party domains you do not control, the practical mitigation is to warm the lookup early with a resource hint so resolution overlaps with work the browser is already doing, rather than blocking a later request.

What to remember

  • Resolution walks a hierarchy: recursive resolver, root, TLD, authoritative.
  • A cold lookup can cost four round trips before any content is requested.
  • Caching at multiple layers means most real lookups never reach an authoritative server.
  • TTL trades propagation speed against cache efficiency; lower it before planned changes.
  • Encrypted DNS protects the query in transit but shifts trust to the resolver operator.

Sponsored video

Advertisement

Checking for a video ad…

How to move a domain to a new host without downtime

A sequence that keeps the site reachable throughout by preparing caches before the change rather than after it.

  1. Step 1. Lower the TTL in advance

    Reduce the TTL on the records you intend to change to 300 seconds, and wait at least the length of the previous TTL so old cached copies expire.

  2. Step 2. Stand up the new host first

    Deploy and verify the new environment using its own address or a temporary hostname, so the destination is proven correct before any traffic is redirected.

  3. Step 3. Match certificates and hostnames

    Issue the TLS certificate for the production hostname on the new host ahead of the switch to avoid a certificate error the moment traffic arrives.

  4. Step 4. Change the records

    Update the A, AAAA or CNAME records at the authoritative provider. With a short TTL in place, most resolvers pick up the change within minutes.

  5. Step 5. Verify from multiple networks

    Query several independent resolvers and confirm all return the new address, then check the site over mobile and fixed connections.

  6. Step 6. Restore the TTL and decommission

    Raise the TTL back to its normal value, keep the old host serving for at least a day to catch stragglers, then retire it.

Frequently asked questions

Sources

About the author

Michael Adeyemi — Senior Technology Writer

Michael writes Inquro's computing and web-infrastructure coverage. He worked for eight years as a platform engineer on high-traffic content systems before moving into full-time technical explanation, and he still prototypes every measurement described in his articles before publishing the numbers.

Qualifications
  • MSc, Distributed Systems — University of Manchester
  • BEng, Computer Engineering — University of Lagos
Experience
  • Eight years as a platform engineer on high-traffic content delivery systems
  • Four years writing standards-based technical documentation
Subject areas:
Web performance, Networking, Systems architecture

Reviewed for factual accuracy by Dr. Rina Halvorsen, Editor-in-Chief (PhD, Cognitive Science), on 15 July 2026.

Structure, claim strength and whether an explanation actually answers the question a reader arrived with.

Inquro articles are commissioned, sourced, reviewed and re-checked under a published editorial policy. Corrections are made in place and dated — write to editorial@inquro.example if you find an error.

Related explainers

More from Technology and connected clusters across the full library.

TechnologyWeb Performance

Core Web Vitals explained: what LCP, INP and CLS actually measure

A practitioner's guide to Core Web Vitals: what Largest Contentful Paint, Interaction to Next Paint and Cumulative Layout Shift measure, how field data differs from lab data, and how to diagnose each metric.

Michael AdeyemiUpdated 28 July 202611 min
ScienceClimate & Environment

How scientists measure Earth's energy balance

An explanation of Earth's energy budget: how satellites measure incoming and outgoing radiation, how ocean floats confirm the imbalance, what radiative forcing means, and where the uncertainty lies.

Dr. Luca MarchettiUpdated 8 July 20269 min
TechnologyNetworking

What actually happens between pressing Enter and seeing a page

A complete walk-through of the pipeline behind a single web request: DNS resolution, TCP and TLS setup, the HTTP exchange, and browser parsing and rendering, with the latency each stage typically adds.

Michael AdeyemiUpdated 14 February 20269 min
TechnologyNetworking

How public key infrastructure turns a key pair into verifiable identity

How public key infrastructure links cryptographic keys to real-world identity through certificates, certificate authorities and trust chains, and how revocation, transparency logs and automation keep the system trustworthy at internet scale.

Michael AdeyemiUpdated 11 April 20269 min

Keep reading

Definitions used here

Go deeper