Recursive Query: The client asks a DNS server (usually provided by an ISP) to find the IP. The server takes full responsibility for tracking down the answer, querying other servers as needed until it returns the result to the client.
Iterative Query: A server responds to a query with the best information it has (usually a referral to another server lower in the hierarchy) rather than seeking the final answer itself.
Caching: To improve speed, DNS servers and clients store previously resolved queries for a set period. This reduces the load on the global DNS infrastructure and decreases latency for the user.
| Feature | Recursive Query | Iterative Query |
|---|---|---|
| Responsibility | The DNS server finds the answer for the client. | The server provides a referral to the next server. |
| Client Load | Low; the client waits for the final answer. | High; the client (or resolver) must manage multiple steps. |
| Usage | Between Client and Recursive Resolver. | Between Recursive Resolver and Root/TLD/Auth servers. |
An A Record points directly to an IP address, making it the terminal point of a resolution. A CNAME points to another domain name, requiring an additional DNS lookup to eventually find an IP address.
Restriction: A CNAME record cannot coexist with other records (like MX or TXT) for the same hostname, which is why it is rarely used at the root of a domain (e.g., example.com).
Check the Record Type: If a question involves email delivery, look for MX records. If it involves IPv6, look for AAAA.
Understand TTL: Time to Live (TTL) determines how long a record is cached. If you change an IP address, the old one will persist in caches until the TTL expires. High TTL is good for stability; low TTL is good for migrations.
The 'Apex' Rule: Remember that you generally cannot put a CNAME at the root domain level (the apex). Use an A record or specialized 'Alias' records provided by some DNS hosts.
Authoritative vs. Non-Authoritative: An answer is 'Authoritative' only if it comes directly from the server that owns the domain's records. Cached answers are 'Non-Authoritative'.