A recursive DNS query asks a configured DNS server to return a definite result: an IP address or an error if the name cannot be resolved. The responding server, called a recursive resolver, performs additional resolution work on the client's behalf. section 3.1.4 section 3.3
A typical recursive resolution proceeds as follows:
- A client such as PC1 sends a recursive query for mail.google.com to its configured DNS server, such as 8.8.8.8. section 3.1.4
- The recursive resolver checks its cache and, if necessary, sends iterative queries to root, TLD, and authoritative DNS servers. section 3.1.4 section 3.3
- The resolver follows referrals, receives the definitive response, and returns the answer or an error to the client. section 3.1.4 section 3.3
- Caching reduces repeated queries; a Cisco router can cache responses while forwarding client queries to an upstream DNS server. section 3.2.2 section 3.3
Cisco IOS forwarding
Configure a router with ip dns server so it answers LAN clients, and configure an upstream server with ip name-server. In the illustrated exchange, PC1 sends a recursive query to R1; R1 sends a recursive query to 8.8.8.8, caches the response, and replies to PC1. Verify learned and manual mappings with show hosts. section 3.2.2
Figure 3.4 Recursive and iterative DNS requests resolve a domain name. In step 1, PC1 attempts to access mail.google.com. Steps 2 and 9 are a recursive DNS exchange between PC1 and the 8.8.8.8 DNS server. Steps 3 through 8 are iterative DNS exchanges between 8.8.8.8 and other DNS servers. Step 10 is an HTTPS exchange between PC1 and mail.google.com.
Trace the complete mail.google.com resolution: PC1 and 8.8.8.8 use a recursive exchange, while 8.8.8.8 uses iterative exchanges with DNS hierarchy servers. section 3.1.4
