Recursive Query Vs Iterative Query in DNS
In this post, we are going to explain the difference between Recursive Query and Iterative Query. Recurvise query vs Iterarative query in DNS explains the difference between the queries that DNS server follows. Client reaches to DNS Server to resolve hostname to IP and IP address to host name.
In Recursive name query, the DNS client requires that the DNS server respond to the client with either the requested resource record or an error message i.e. the record or domain name doesn’t exist.
If DNS server is not able to resolve the requested query then it forwards the query to another DNS server until it gets an answer or the query fails. We’ll take very simple example to explain it, let’s assume that you call either yellow pages or just dial to get the information about all the good restaurants near your locality. In this example, Just dial or Yellow pages are working on behalf to get you the required information.
Recursive query is made to DNS server by DNS client or by DNS server that is configured to pass unresolved query to another DNS Server. By default recursive query is enabled but it can be disabled if you don’t want to use it in your environment.
Best way to remember Recursive query is to memorize that burden is on Server to resolve the query.
An iterative name query is one in which a DNS client allows the DNS server to return the best answer it can give based on its cache or zone data. If the queried DNS server does not have an exact match for the queried name, the best possible information it can return is a referral (that is, a pointer to a DNS server authoritative for a lower level of the domain namespace).
The DNS client can then query the DNS server for which it obtained a referral. It continues this process until it locates a DNS server that is authoritative for the queried name, or until an error or time-out condition is met.
Best way to remember Iterative query is to memorize that burden is on Client to resolve the query.