DNS

DNS turns names like example.org into the records computers need — IP addresses (A), aliases (CNAME), mail servers (MX) — through a chain of servers and layers of caches.

Look up www.example.org (A)

Browser
Resolver
Root
.org
Nameserver

example.org zone (on its nameserver)

example.orgA203.0.113.10
www.example.orgCNAMEexample.org
example.orgMX10 mail.example.org
mail.example.orgA203.0.113.25

TTL 3600 s on every record.

www.example.org is an alias (CNAME) for example.org, so the answer comes in two parts.

Step 1 / 7
DNS queries
0
Time (typical)
0 ms
Look up
When

Times are typical round trips, for illustration.

What's happening?

  1. The browser and operating system check their caches first; a cached answer costs nothing.
  2. Otherwise a resolver asks the root, then the .org servers, then the domain's own nameserver — or answers from its cache if someone asked recently.
  3. Every answer carries a TTL saying how long it may be cached; until it expires, changes to the record are not seen.

Complexity

Time
0 queries from cache · up to 4 network queries when nothing is cached
Space
Cached answers on every layer, for their TTL

Where you'll meet it

Pointing a domain at a new server, setting up email (MX), using a CDN (CNAME), and every "it works for me but not for them" after a DNS change.

Common mistake

Changing a record and expecting everyone to see it at once. Old answers stay cached until their TTL runs out — lower the TTL before a planned move.

FAQ

What is a TTL?

Time to live: how many seconds an answer may be cached. 3,600 means caches can reuse it for an hour.

What is the difference between A and CNAME?

An A record gives an IP address; a CNAME says "this name is an alias of that name — look that one up instead".

What is an MX record?

It names the server that receives email for the domain, with a priority. Email follows MX, not the website's A record.