Interview Prep/Networking/DNS & Service Discovery

A customer types www.example.com in a browser. Walk through how DNS resolves it.

BeginnerScenarioDNS & Service Discovery
Answer

Situation read → Tests whether you know the resolver hierarchy and caching, not just "DNS turns names into IPs".

What I'd do →

  1. Browser and OS check their caches and /etc/hosts first
  2. The stub resolver asks the configured recursive resolver (for example 10.0.0.2 in a VPC or 1.1.1.1)
  3. On a cache miss the recursive resolver asks a root server, then the .com TLD servers, then the authoritative nameserver of example.com
  4. The answer returns with a TTL and is cached at every layer
  5. Watch it with dig +trace www.example.com

Why → Each hop only knows who to ask next, and TTLs make the whole system fast and cheap.

Interview tip → Name the roles: stub, recursive, authoritative.

All Networking questions Roadmap: Networking for DevOps

More on DNS & Service Discovery