DNS & Naming

an iterative query

An iterative query is the do-it-yourself style: you ask a server, and instead of the final answer it gives you the best referral it has — go ask them. It is like calling an office and hearing we don't handle that here, but try this other department, here's their number. You hang up, call that next office, and repeat until someone finally has the answer. Each server takes you one hop closer, but you keep making the calls.

Concretely, this is how a recursive resolver navigates the server hierarchy. The resolver asks a root server for www.example.com; the root does not resolve it but returns a referral — the NS records pointing at the .com servers. The resolver then asks a .com server, which refers it to example.com's authoritative servers. The resolver asks one of those, which is authoritative for the zone and finally returns the A record. At each step the server answers only what it knows and hands back a referral to the next level; the resolver, not the servers, drives the loop down the tree.

Why it matters: iteration is what keeps the upper DNS servers fast and stateless. A root or TLD server fields enormous query volumes, so it must not get stuck doing long chases on behalf of every caller — it gives a quick referral and moves on. That is why, by convention, root and TLD servers answer iteratively (referrals only) and refuse to do recursion. The contrast to keep straight: an iterative query puts the burden on the asker to follow referrals; a recursive query puts the burden on the server to deliver the final answer.

Resolving info.example.org iteratively: ask a root server -> it refers you to the .org servers; ask a .org server -> it refers you to example.org's authoritative servers; ask one of those -> it returns the address. Three referrals, then one answer.

Each server hands back a referral; the asker keeps walking down.

Root and TLD servers generally do iterative only — they refuse to do the full recursive chase. That deliberate refusal is part of how they stay fast under enormous load.

Also called
iterationiterative resolutionnon-recursive query疊代查詢迭代查詢