A non-recursive query, also called an iterative query, is a DNS request that asks a name server to provide only the information it already holds or to refer the client to another server, without performing additional lookups on the client's behalf. Non-recursive queries form the backbone of DNS traffic between servers, with recursive resolvers using them to walk the DNS hierarchy by querying root servers, top-level domain servers, and authoritative servers in sequence. Understanding the distinction between recursive and non-recursive queries is operationally critical for server design, troubleshooting, security configuration, and preventing misconfigurations such as stub clients pointed at authoritative-only servers that refuse recursion.
How non-recursive query works
In a non-recursive query, the client sends a question and the server replies with the best information it has, without doing further lookups on the client's behalf. Recursive resolvers use this approach to walk the DNS hierarchy.
- Client sends the query: The client, usually a recursive resolver, sends a query to a name server with the recursion desired flag unset or with no expectation that the server will recurse.
- Server checks its data: The server looks in its zone data if it is authoritative for the name, or in its cache if it keeps one.
- Server returns an answer: If the server holds the answer, it returns it. An authoritative server marks the response as authoritative.
- Server returns a referral: If the server does not hold the answer, it returns a referral listing name servers closer to the name, such as the servers for a child zone.
- Client follows the referral: The client sends the same question to a server named in the referral and repeats until it receives an answer or an error.
The server never queries other servers for the client, so the work of following referrals stays with the asker. A resolver typically starts at a root server, then queries a top-level domain server, then the authoritative server for the domain, using non-recursive queries at each step.
Common misconceptions about non-recursive query
Iterative queries are not inherently slower. Each step is a simple lookup, and a resolver that caches referrals and answers often skips most of the steps.
Stub resolvers normally send recursive queries to a resolver. The non-recursive exchange happens between the resolver and authoritative servers, so it is mostly invisible to end clients.
A referral is a normal response, not a failure. It points the resolver to name servers closer to the answer, and a missing referral is a delegation problem rather than a query-type problem.
An authoritative-only server does not resolve names outside its zones, even when the recursion desired flag is set. It typically returns a referral or a refusal, which is often mistaken for an outage.
A caching server can answer a non-recursive query from its cache if the data is there. If it is not cached, the server does not go and fetch it for that query.