How DNS Works: From a Domain Name to an IP Address

The lookup chain behind every URL: recursive resolvers, root and TLD servers, authoritative answers, TTLs and caching — plus the record types you'll actually meet and the failures they explain.

Published 2026-10-23

Every connection you make starts with a question: what IP address is this name? DNS — the Domain Name System — is the distributed database that answers it. It is also the reason “the site is down” so often means “the site is fine; its name is broken”. This guide follows one lookup step by step, catalogues the record types you’ll actually encounter, and explains the behaviours (caching, TTL, “propagation”) that puzzle everyone the first time they change a record.

The lookup, step by step

You type devclamp.com into a browser. Before any HTTP happens:

  1. Local caches answer if they can. The browser, then the operating system, check their caches. A hit ends the story in under a millisecond.
  2. The stub asks a recursive resolver. Your OS forwards the question to the resolver from your network settings — usually your ISP’s, or a public one like 1.1.1.1 or 8.8.8.8. The recursive resolver does the legwork and caches aggressively.
  3. The resolver asks a root server: “who handles .com?” The root doesn’t know the answer, but knows the TLD (top-level domain) servers for .com and refers the resolver to them.
  4. The resolver asks a .com server: “who handles devclamp.com?” Another referral — to the authoritative name servers for that domain (often your registrar’s or your DNS host’s, e.g. Cloudflare’s).
  5. The resolver asks the authoritative server: “what is the A record for devclamp.com?” This time it gets an answer: an IP address, plus a TTL saying how long the answer may be cached.
  6. The answer travels back, being cached at the resolver (and then by your OS and browser), and the browser connects to the IP.

The design lesson is in the referrals: no single machine knows the whole namespace. Root servers know TLDs, TLD servers know domains, authoritative servers know their own records — a hierarchy of caches and delegations that scales to every name on Earth.

The record types you’ll actually meet

TypeWhat it holdsExample
AAn IPv4 addressdevclamp.com → 172.67.x.x
AAAAAn IPv6 addressThe same name, 128-bit answer
CNAMEAn alias to another namewww.example.com → example.com
MXMail servers for the domain, with prioritiescalrepo.com → mail provider
TXTArbitrary text — verification tokens, SPF/DKIM policyv=spf1 include:… ~all
NSThe authoritative name servers for the (sub)domainDelegation itself, as a record
SOAThe zone’s administrative record (serial, refresh timers)One per zone
PTRReverse lookup: an address back to a nameMostly for mail-server reputation

Two rules cause most confusion: a CNAME cannot coexist with other records at the same name (which is why CNAMEs at the bare domain — the “apex” — are special and providers implement workarounds), and MX/NS records must point to names, not IP addresses.

TTL, caching, and the myth of propagation

Every record carries a TTL (time to live, in seconds): how long resolvers may cache it. Change a record with a 24-hour TTL and some users will keep receiving the old answer for up to a day — not because anything is “propagating” across the internet, but because caches everywhere are independently counting down the promise you made yesterday. Nothing travels; things expire.

The operational consequence: before a planned change (a migration, a host switch), lower the TTL to 300 seconds a day or two in advance, make the change, verify, then raise it again. And when something looks half-broken after a change — fine for you, stale for a colleague — suspect a cache holding the old answer before you suspect the new record.

Who sees your question?

Your recursive resolver sees every name you look up, which is a meaningful privacy fact: the default resolver is your ISP’s. Public resolvers trade that for their own (published) logging policies, and DNS-over-HTTPS / DNS-over-TLS encrypt the stub-to-resolver leg so the local network can’t watch. Note the asymmetry, though: encrypting DNS hides the name you asked about; the site you then connect to is still visible via its IP — and the address you arrive from is visible to the site, which is what our What’s My IP tool displays, along with whether that address is public or a shared one.

Failures, translated

Once DNS has done its work you hold an IP address and the story hands over to routing, NAT and the rest of the network stack — the world our subnet and IP guides cover. DNS is just the phone book; but as any day with a broken record teaches, nobody connects to anything without it.

Related tools

Related guides