Skip to main content
Explainer

How DNS works

Type example.com in the address bar; ~50 milliseconds later the page loads. In between, the Domain Name System — the distributed directory that translates human names into IP addresses — walked a tree of servers around the world. This is what happened.

The cast of characters

The walk, step by step

You type example.com into the address bar.

  1. The browser asks the stub resolver. The stub probably has it cached; assume not.
  2. The stub asks its configured recursive resolver. Same — probably cached; assume not.
  3. The recursive resolver asks a root server: "Who handles .com?" The root server replies with the addresses of the .com TLD servers.
  4. The recursive resolver asks a .com TLD server: "Who is authoritative for example.com?" It replies with the NS records — typically a couple of name-server hostnames.
  5. The recursive resolver asks an authoritative server: "What's the A record for example.com?" It replies with the IP.
  6. The recursive resolver caches the answer (for the TTL the authoritative server set) and returns it to your stub. Your stub returns it to the browser, which finally opens a TCP connection.

Steps 3–5 are skipped almost all the time because everything is cached. A cold lookup is ~150 ms across continents; a cache hit is <5 ms.

Beyond A records

The same hierarchy serves dozens of record types. The common ones:

IPFerret's DNS lookup tool queries any of these.

Caching, and why it matters

Every DNS answer carries a TTL — how long a downstream resolver should consider it valid. Low TTLs (60–300 seconds) let you flip records fast for blue-green deployments; high TTLs (hours to days) reduce upstream load and speed up repeat lookups.

The trade-off bites during outages: if you set a 1-hour TTL on an A record and the upstream goes down, traffic keeps hitting the dead IP for up to an hour after you've updated DNS. Many CDNs solve this with their own short-TTL anycast layer ahead of your origin.

Modern privacy: DoH, DoT, DNSSEC

When DNS quietly misbehaves

You can chase any of these with IPFerret's DNS lookup tool — it hits Cloudflare's DoH endpoint, so it bypasses your ISP's resolver entirely and gives you the authoritative-side answer.