DNS Recursive Queries vs Iterative Queries
DNS Recursive Queries vs Iterative Queries
Ace Fekay, MVP, MCT, MCTIP EA, MCTS Windows 2008 & Exchange 2007, MCSE & MCSA 2000/2003, MCSA Messaging
Microsoft Certified Trainer
Microsoft MVP: Directory Services
The definition actually depends on context, meaning which machine is doing the query.
Reason why I say that is that basically a recursive query means the machine sends the query, such as a client machine, or even a DC, to a DNS server for resolution. Recursive name queries are generally made by a DNS client to a DNS server, or by a DNS server that is configured to pass unresolved name queries to another DNS server, in the case of a DNS server configured to use a forwarder.
Interative queries is a request from a client tells the DNS server that the client expects the best answer the DNS server can provide immediately, without contacting other DNS servers. The process then relies on the client to continue the process possibly by using a referral where the DNS server supplying the client NS or A records of a DNS server that is closer to the namespace which may possibly provide the answer. However we don't see that with the normal sense of the word, 'query,' when a client sends a request to a DNS server, which we are more familiar with. For the most part, the DNS resolver service on Windows clients are basically 'stub resolvers' that rely on a recursive-enabled DNS server to resolve queries it is not aware of. Of course you can create resolver scripts to preform an interative query.
However, with a recursion request from a client to a DNS server, which as I said is what we normally think of using the term 'query,' the DNS server will do its best to resolve it, either by using the Root Hints, which is essentially an interative query to the Roots to devolve the namespace from the TLD backwards, or a query to a Forwarder, if configured with a Forwarder, which is essentially a recursion request because technically it's not an iterative request, even though the server repeats (iterates) when trying to find the answer.
You can make nslookup perform an iterative query by using the "norecurse" option (set norecurse). In this situation the DNS server will give its best response, without looking elsewhere other than its cache or zones its authoritative for.
Microsoft links on the Subject
Recursive and Iterative Queries - With a recursive name query, the DNS client requires that the DNS server respond to the client [...]:
http://technet.microsoft.com/en-us/library/cc961401.aspx
How DNS query works: Domain Name System(DNS)Jan 21, 2005 ... As DNS servers process client queries using recursion or iteration, they discover and acquire a significant store of information about the ...
http://technet.microsoft.com/en-us/library/cc775637(WS.10).aspx
Cool site with a scripted demo showing how it works and the differences between a recursive and interative query:
Recursive/Iterative Queries in DNS (Chapter 2)
http://media.pearsoncmg.com/aw/aw_kurose_network_2/applets/dns/dns.html
To go further...
The following quote is a non-Microsoft definition, but it still applies, no matter what DNS server service is used. The quote was taken from:
http://www.linuxjournal.com/article/4198
"Since ns.someisp.com isn't authoritative for wiremonkeys.org and hasn't recently communicated for any host that is, it begins a query of its own on the user's behalf. The process of asking one or more queries in order to answer other queries is called recursion."
Does that make sense so far?
So to take it another step further...
Keep in mind, recursion is not necessarily resolution. The reasons is the process of following a chain of delegations from one set of content DNS servers to another,starting at some root servers, is termed "resolution"; as exemplified in section 6.3 of RFC 1034. It is not termed "recursion". "Recursion" is something else. The definition of "recursion" is the act
of a server sending back-end queries (of _whatever_ sort) to another server. Both query resolution, where back-end queries are sent to content DNS servers, and forwarding, where back-end queries are sent to proxy DNS servers, are forms of recursion.
Therefore...
Resoluton can be provided many times from its own authoritative zones where no recursion involved.
A query can be resolved from its cache where no recursion involved (directly, because it's in its cache).
By forwarding, with the forwardee doing the resolution where recursion is involved. However if it forwards it out, it essentially becomes an interative query because it's proxying the request elsewhere for the client, such as an indirect query for the client, but essentially this can be viewed as an recursive query by the DNS server itself acting as a recursive client.
Or DNS can perform the query resolution itself where recursion is involved. An example is when Forwarding is not enabled, and the DNS server uses the Root Hints, where essentially it's querying the Roots in a recursive manner devolving the DNS name hierarchy from the TLD backwards.
And more...
Got it?
I hope that was easy. Next week we'll discuss helion particles (a-particle of the helium-3 nucleus) and their mass.
Ace Fekay