Recursive query is the most common way of query, will take the place of the client at the request of the domain name server (DNS servers) at a lower level domain name query, if the domain name server cannot directly reply, the domain name server will be up and down in the domain of each tree branches for recursive query, will eventually return the query results to the client, the domain name server during a query, The client will be completely in a wait state. Iteration: Get where should I go Recursion: Should I go to someone else
Example: (red for the query, blue for the prompt returned by an iterative query, brown for the IP information returned by a recursive query)
Example description: Sends A recursive query request A to B, B to C sent iterative query requests (the next section describes iterative queries), get C gives tips, after B send D iterative query request, after get hints of D is given, B to E iteration requests, after get hints of E is given, B to F iterative query request, after get hints of F is given, B gets the IP address of G returned by F, and B returns the IP address of G to A. The whole query ends.
How iterative queries work
Iterative queries and weighing guidance, when the server using iterative query is able to make other server returns an optimal query hints or host address, if the best query point need to query the host address, it returns the host address information, if the server will not be able to query directly to the host address, is according to clew, in turn, the direction of the query, Until the server gives you a hint that contains the address of the host you want to look up, each time you get closer to the root server (up), and when you find the root domain name server, you look down again. As can be seen from the figure in the previous section, B visits C, D, E, F and G, all of which are iterative queries. First, B visits C and gets the prompt message to visit D, then begins to visit D. At this time, since it is an iterative query, D returns the prompt message to B, telling B that it should visit E, and so on.
Description: suppose you are looking for a company you’ve never been there, you will have two solutions, 1 is looking for a person to ask the way for you, it could be your assistant, 2 is to ask the way, through each intersection, ask a person, it’s like a recursive query and iterative queries, recursive query here represents your 1 kind of solution, and the iteration is 2 kinds of solutions.
If configured recursive query and iterative query
By default, DNS servers accept both iterative and recursive queries from other clients (other DNS servers).
Note: In the DNS server properties, you may confuse the “Do not recurse” option in the advanced TAB with the “Do not recurse this field” option in the forerunner TAB, which controls the type of query that will be accepted.