How DNS Works: Recursive vs Iterative

TL;DR
DNS resolves a domain name by first checking the local cache or DNS resolver. If not cached, recursive mode asks root servers, then TLD servers, then authoritative servers to obtain the IP, returning it to the client. Iterative mode divides the lookup steps among servers, returning referrals until the client reaches the authoritative answer, using UDP for speed.
Transcript
Hello friends, Welcome to Gate Smashers In last video we discussed that how DNS actually works. And if we talk about DNS. What are the different levels of servers in DNS. So here we are talking about. The last point that I told in the last video was. How is a DNS query solved. Either recursive method or iterative method. Meaning, it is a very simpl... Read More
Key Insights
- DNS caching reduces repeated lookups by storing recently resolved IPs at the local resolver.
- A DNS resolver can perform recursive lookups by querying root servers, TLD servers, and authoritative servers in sequence.
- In recursive mode the root server and subsequent servers are responsible for traversing the lookup path until the IP is found.
- In iterative mode the resolver gets referrals from each server rather than following through to the final IP itself.
- Root servers guide the resolver to the appropriate TLD server based on the domain suffix.
- Top level domain servers are responsible for generic domains and direct the query toward authoritative servers.
- Authoritative servers hold the actual IP addresses for domains and provide them to the requester.
- DNS uses UDP for speed, with TCP used only when necessary for reliability or larger data transfers.
- More videos from this channel:
- More from this channel: Gate Smashers
Install to Summarize YouTube Videos and Get Transcripts
Explore YouTube Video Summarizer or Get YouTube Transcript Extractor
Questions & Answers
Q: What is the first step in resolving cricinfo.com in DNS
The first step is to search the local cache or DNS resolver for the IP address of cricinfo.com. If the IP is found there, the lookup is completed quickly and the IP is returned to the client. If not found, the resolver proceeds to query higher level DNS servers to locate the authoritative source.
Q: How does recursive DNS resolution proceed after a miss in local cache
In recursive resolution, after a miss in local cache, the resolver sends a query to the root server to locate the path to the domain. The root server points to the appropriate top level domain server for com, and from there the request is directed to authoritative servers that hold the actual IP address for cricinfo.com.
Q: What role do root servers play in DNS queries
Root servers act as the first step in the hierarchy for unresolved DNS queries. They help determine which top level domain server should handle a domain like cricinfo.com, effectively directing the resolver toward the correct path to reach the authoritative server that holds the IP address.
Q: What is the difference between recursive and iterative DNS approaches
In recursive DNS the resolver handles the full lookup path by querying successive servers until the IP is found and then returns it to the client. In iterative DNS, each server provides a referral to another server that may have the answer, and the resolver follows these referrals step by step until it reaches the authoritative source.
Q: How are authoritative servers used in DNS resolution
Authoritative servers are the source of truth for domain IP mappings. Once the resolution path reaches them, they respond with the actual IP address for the domain, which is then propagated back through the chain to the client, completing the lookup.
Q: Why does DNS prefer UDP over TCP for queries
DNS uses UDP because speed is prioritized for domain name lookups; UDP allows for fast, lightweight queries without the overhead of a three-way handshake. TCP is only used when reliability or larger data transfers are required, making UDP the default for most DNS queries.
Q: What happens after the IP address is obtained in DNS resolution
After obtaining the IP address from the authoritative server, the IP is sent back to the root server or directly to the local resolver, which then returns the IP to the client. The client can then establish a connection to the destination host using that IP, completing the domain lookup.
Q: How does DNS caching affect subsequent domain lookups
DNS caching stores frequently requested domain IPs at the local resolver or ISP cache, so subsequent requests for the same domain can be resolved without contacting root or authoritative servers again. This speeds up responses and reduces network load for repeated lookups.
Summary & Key Takeaways
-
DNS resolution starts with local cache, then moves to recursive or iterative methods to find the IP address for a domain. In recursive mode the resolver visits root, TLD, and authoritative servers and returns the final IP to the client. Iterative mode sends referrals back to the resolver rather than completing the full lookup itself.
-
DNS caching helps avoid repeated lookups by ISP caches, speeding subsequent requests for the same domain. The local DNS resolver plays a central role in both recursive and iterative lookups and can keep popular results in cache for quick responses.
-
DNS primarily uses UDP for speed, reserving TCP for more reliable handshakes or larger transfers, since fast replies are the main goal in domain name queries and the backend processes should stay fast.
Read in Other Languages (beta)
Share This Summary 📚
Summarize YouTube Videos and Get Video Transcripts with 1-Click
Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator
Explore More Summaries from Gate Smashers 📚






Summarize YouTube Videos and Get Video Transcripts with 1-Click
Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator