Networking interview question · Most asked
How does DNS resolution work, and what does a record's TTL control?
Summary
A stub resolver asks a recursive resolver, which (if not cached) queries a root server, then the TLD server, then the domain's authoritative server, and caches the answer for the record's TTL. The TTL controls how long resolvers and clients may reuse an answer, and therefore how quickly changes propagate.
Longer Answer
Before migrations, lower TTLs at least one old-TTL period in advance. Negative answers (NXDOMAIN) are cached too, per the SOA record. Applications can cache beyond the TTL (JVM settings, connection pools that never reconnect). Cloud DNS adds private zones, split horizon and routing policies (weighted, latency, failover).
Key Points
- Recursive resolver walks root -> TLD -> authoritative.
- Answers cached for the TTL.
- Lower TTLs before changes.
- Negative caching and client caches extend staleness.
Deep dive: Cloud Networking in Production: The Migration That Took Two Days
Explanation
What interviewers look for
The full resolution path and practical TTL planning.
Follow-up questions
- How would you migrate a domain with zero downtime?
More most-asked Networking questions
- How does NAT work, and what are its limits?
- What's the difference between stateful and stateless firewalls? Give cloud examples.
- What happens, at the network level, when you type a URL into a browser and press Enter?
- What is CIDR notation? How many usable addresses are in a /26, and in an AWS /26 subnet?
- What does TLS provide, and how does certificate validation work?
- What's the difference between TCP and UDP, and when would you choose UDP?
- What do 502, 503 and 504 errors from a load balancer usually mean?
- A service is unreachable. How do you troubleshoot it systematically?