Communication Networks · Visualized

Domain Name System (DNS)

Addressing & Names

How devices get numbers, find each other on the LAN, and turn human-readable names into addresses.

7 interactive subtopics — each one animated, step-through and explained.

Domain Name System (DNS)

Addressing & Names

Humans remember names (example.com); routers need IP addresses. DNS bridges the gap with a worldwide hierarchy of servers: a recursive resolver walks from the root servers to the .com TLD servers to the domain's own authoritative server, returns the record, and caches it so the next visitor skips most of the journey.

How Domain Name System (DNS) Works

  1. The browser and OS check their local caches — a hit answers instantly.
  2. Otherwise the stub resolver asks a recursive resolver (usually your ISP or 8.8.8.8).
  3. The resolver asks a root server, which answers: "ask the .com TLD servers".
  4. The TLD server points at the domain's authoritative nameserver, which returns the actual A/AAAA record.
  5. The answer travels back and is cached at every level for its TTL — repeated lookups get cheaper.

Domain Name System (DNS) Worked Example

Try it: Look up example.com for the first time, then again.

First visit: cache miss → resolver → root ("try .com") → TLD ("try ns1.example.com") → authoritative ("93.184.216.34") — typically 3–4 UDP round-trips. Second visit: the resolver's cached answer is returned in a single datagram.

Laptopstub resolvercache: —Recursive resolver8.8.8.8—Root server.—TLD server.com—Authoritativeexample.com—each arrow is a UDP round-trip
query / answer in flight record cached
Stage 1 / 10
FIRST LOOKUP — nothing cached anywhere. Watch the referral chain walk root → TLD → authoritative.

Domain Name System (DNS): Key Facts to Remember

Record typesA (IPv4), AAAA (IPv6), CNAME (alias), MX (mail), NS (nameserver)
Cachingevery record carries a TTL — shorter TTLs update faster, longer TTLs ease load
TransportUDP port 53 for lookups; TCP for large answers and zone transfers

Recommended resourcesAffiliate links · may earn us a commission

Recommended for learners

Cloud hosting for side projectsShip the portfolio project that gets you hired — free credits for new accounts.Claim credits Pro code editor & AI assistantWrite, debug and explain code faster while you practice the patterns here.Try it free Structured coding coursesVideo courses that pair well with visual practice — pick one language and go deep.Browse courses

See how packets really travel

Networks are built on the structures and algorithms you can watch step by step — queues, trees, and routing algorithms.