Free preview

Iterative vs. Recursive Resolution

Why this matters: the hierarchy tells you where the answers live. This lesson is about who does the walking — and the answer determines where load lands in the world's most heavily queried system.

Key takeaway

There are two primary methods for performing a DNS query. In an iterative query the local server navigates the hierarchy itself, asking each tier in turn. In a recursive query the burden is passed from server to server, each one asking the next on the previous one's behalf.

Iterative resolution

The local server queries the root, TLD, and authoritative servers sequentially, taking responsibility for navigating the hierarchy. Each server it asks responds with a referral — not the answer, but the address of who to ask next.

The local server does all the work and holds all the state. Every other server answers one simple question and forgets about it.

Recursive resolution

The client queries the local server, which then queries the root. The root forwards the request to the next level, and so on — the burden of resolution is passed from server to server, with the answer travelling back down the same chain.

Each server holds the request open while waiting for the one below it — so state accumulates at every tier simultaneously.

The comparison

AspectIterativeRecursive
Who navigatesThe local serverEach server in turn
What upstream servers returnA referral to the next tierThe final answer
Load on root and TLD serversLow — answer one question and forgetHigh — hold state until the chain completes
Where results get cachedThe local server sees every intermediate referral and caches themMainly the endpoints
Client complexityHigher for whoever iteratesMinimal — ask once, get an answer
Typical useResolver to the hierarchyClient (stub resolver) to its local resolver

Real deployments use both

The two are not competing options at the system level — they are used at different segments of the same lookup:

Your laptop's stub resolver does not want to walk the hierarchy — it makes a single recursive request to the configured resolver and waits for a final answer. The resolver then performs iterative queries up the hierarchy on its behalf.

This split is why the local resolver is such an effective cache: because it sees every intermediate referral, it caches not just the final answer but the TLD and authoritative server addresses too — which is what lets later lookups skip tiers entirely, as the next lesson shows.

Key takeaway

Iteration keeps shared global infrastructure cheap and stateless; recursion keeps clients simple. Real DNS uses recursion at the edge and iteration in the core — the opposite arrangement would not survive internet-scale traffic.

Interview signal by level

LevelWhat a strong answer sounds like
L4Can define both terms.
L5Knows the preference: "iterative is used upstream so root and TLD servers aren't overloaded."
Staff+Describes the hybrid and generalizes it: "recursive from stub to resolver, iterative from resolver up. Keeping shared infrastructure stateless is the same principle behind edge caching generally — and it's why the resolver ends up caching intermediate referrals, not just answers."

Next: the layer that means most lookups never reach the hierarchy at all.

Enjoying the preview?

Create a free account to unlock the rest of this course, the in-browser judge, and live AI mock interviews.

Sign up free to continue