DNS & Naming

a recursive query

A recursive query is the kind where you ask one question and demand one final answer — no homework for you. It is like phoning a capable concierge and saying just get me the address; do not call me back with directions to someone else who might know. You ask the resolver for www.example.com, and you expect either the address or a clean failure, not a chain of leads to follow yourself.

Concretely, when your stub resolver sends a recursive query to a recursive resolver, it sets a flag asking for recursion, and the resolver takes on the full responsibility of finding the answer. To do that, the resolver itself usually performs iterative queries against the server hierarchy: it asks a root server, gets referred to the TLD servers, asks them, gets referred to the zone's authoritative server, asks that, and finally receives the address. Then it returns that single resolved answer to you. The word recursive describes the service the resolver promises you (I will get the whole answer), even though the resolver does the legwork step by step.

Why it matters: recursion is what makes DNS painless for ordinary clients — your laptop stays dumb and simple, while a powerful, well-connected resolver does the multi-step chase and caches the result for next time. The key contrast is with iterative resolution: in a recursive query the burden is on the server you asked; in an iterative one the burden stays on you, getting referrals you must follow yourself. Most clients use recursion; most steps between servers in the hierarchy are iterative.

Your computer sends one recursive query to its resolver: address of www.example.com, please. It waits and gets back exactly one thing — 93.184.216.34 — even though the resolver had to ask three different servers behind the scenes to produce it.

One question in, one final answer out — the server carries the burden.

Recursive and iterative are about who carries the burden, not two unrelated systems. A recursive resolver typically fulfills your recursive query by performing iterative queries up the hierarchy on your behalf.

Also called
recursionrecursive resolution遞迴查詢遞迴解析