@HASSAN BIN NASIR DAR
Recursive: A recursive query forces a DNS server to respond to a request with either a failure or a success response. DNS clients (resolvers) typically make recursive queries. With a recursive query, the DNS server must contact any other DNS servers it needs to resolve the request. When it receives a successful response from the other DNS server (or servers), it then sends a response to the DNS client. The recursive query is the typical query type used by a resolver querying a DNS server and by a DNS server querying its forwarder, which is another DNS server configured to handle requests forwarded to it.
When a DNS server processes a recursive query and the query can't be resolved from local data (local zone files or cache of previous queries), the recursive query must be escalated to a root DNS server. Each standards-based implementation of DNS includes a cache file (or root server hints) that contains entries for the root DNS servers of the Internet domains. (If the DNS server is configured with a forwarder, the forwarder is used before a root server is used.)
Iterative: An iterative query is one in which the DNS server is expected to respond with the best local information it has, based on what the DNS server knows from local zone files or from caching. This response is also known as a referral if the DNS server isn't authoritative for the name. If a DNS server doesn't have any local information that can answer the query, it simply sends a negative response. A DNS server makes this type of query as it tries to find names outside of its local domain (or domains) (when it isn't configured with a forwarder). It might have to query outside DNS servers in an attempt to resolve the name.
The following figure shows an example of both types of queries.

The diagram shows how multiple queries were used to determine the IP address for www.contoso.com
. The query sequence is described as follows:
- Recursive query for
www.contoso.com
(A resource record).
- Iterative query for
www.contoso.com
(A resource record).
- Referral to the
.com
name server (NS resource records, for .com
); for simplicity, iterative A queries by the DNS server to resolve the IP addresses of the Host names of the name server’s returned by other DNS servers have been omitted.
- Iterative query for
www.contoso.com
(A resource record).
- Referral to the
contoso.com
name server (NS resource record, for contoso.com
).
- Iterative query for
www.contoso.com
(A resource record).
- Answer to the iterative query from contoso.com server (The
www.contoso.com
IP address).
- Answer to the original recursive query from local DNS server to resolver (The
www.contoso.com
IP address).
I hope this has been helpful!
Your feedback is important so please take a moment to Accept answers.
If you still have questions, please let us know what is needed in the comments so the question can be answered.
Thank you for helping to improve Microsoft Q&A!