DNS recursive query and iterative query
Summary
There has always been confusion about the "recursion" and "iteration" approaches to DNS queries. Most people just tell you. "DNS clients request recursive queries to DNS servers," and "query requests between DNS servers are iterative queries," After listening to the so-called ... Until I read the "network operating system--windows Server 2003 Configuration and Management" (Chen Jingliang Editor-in-Chief) A book, understand the specific situation. The following are mainly "excerpts", including drawings. Do not organize themselves, mainly because it is written really good, and organized a certain degree of trouble. recursive query
Recursive queries require the DNS server to return results in all cases. The query request that a general DNS client presents to the DNS server belongs to a recursive query. The standard recursive query process is shown below:
Suppose the domain name is test1.abc.com host to query the IP of the server domain name is www.info.xyz.com.
Step one: abc.com the query to the local DNS server; the
second step: Local DNS server queries are not detected, and the root hint file is queried to the root DNS server responsible for the. com top-level domain;
third: The root DNS server is based on the "xyz.com" in the queried domain name Again to xyz.com DNS server query,
Fourth step: xyz.com DNS server directly resolve domain name www.info.xyz.com, the query results in accordance with the original way back to the request query client test1.abc.com.
a query combining recursion and iteration
Using the above recursive query method, the root DNS server needs to go through a layer by query to obtain query results, inefficient, but also increase the burden of the root DNS server. To solve this problem, we actually use recursive and iterative Query method, as shown in the figure:
The query process is as follows:
Step one: abc.com the query to the local DNS server; the
second step: The local DNS server is not queried, and the root hint file is queried to the root DNS server responsible for the. com top-level domain;
Step three: The root DNS server directly returns the subordinate DNS server IP address to the local DNS server;
step fourth: The local DNS server queries directly to the xyz.com DNS server.
In this, the iterative query gives the DNS client the task of querying the DNS server, and the DNS server simply returns a prompt to the client, telling it to continue the query to another DNS server until the desired result is found. If the last DNS server does not provide the required answer, the query fails. So, "the query request between the general server belongs to the iterative query." Personal Understanding
It doesn't make sense to say what a recursive query is and what is an iterative query alone. Recursion and iteration are in themselves the behavior in a group (not 1 or 2), saying that "DNS clients request recursive queries to DNS servers," and "query requests between DNS servers are iterative queries". It is conceptually wrong.
So now we can talk about why we call it "recursive query." "Iterative query."
From the first example, we stand on the test1.abc.com point of view, after sending out a query request, the request is submitted through layer by layer, until the final result is a clear resolution to return it to test1.abc.com. This process shows that it is recursive .
From the second example, we stand on the abc.com server point of View , issued a query request, the query results returned directly, if not resolved, then we will conduct the next query (according to the return of the guidelines), so that is repeated the same operation, this is called iteration. And we said above the "recursive integration iteration", where the recursion is not directly to the operation of our test1.abc.com host, but abc.com, query host test1.abc.com is also in the end to receive a final query results oh, like the recursive example said.