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 →
- Browser and OS check their caches and
/etc/hostsfirst - The stub resolver asks the configured recursive resolver (for example 10.0.0.2 in a VPC or 1.1.1.1)
- On a cache miss the recursive resolver asks a root server, then the
.comTLD servers, then the authoritative nameserver of example.com - The answer returns with a TTL and is cached at every layer
- 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.
More on DNS & Service Discovery
What is the difference between an A record and a CNAME, and when do you use each?BeginnerWhy can't you put a CNAME at the zone apex, and what do you use instead?BeginnerYou are moving a site to a new server. What do you do with DNS to make the cutover smooth?BeginnerHow do you find which nameservers are authoritative for a domain and query them directly?BeginnerWhat DNS records do you set up for company email?BeginnerWhen do you use /etc/hosts and when DNS?Beginner