Domain Names and DNS
Routers deliver to IP addresses, but nobody wants to print 203.0.113.10 on a bakery's paper bags. People remember crumbbakery.com. Something has to translate the friendly name into the number every time someone visits, and do it in a few milliseconds. That something is the Domain Name System.
The rule
DNS turns a name people remember into an address computers can route.
Reading a domain name. Read it from right to left, from the most general part to the most specific:
comis the top-level domain (TLD). Others includeorg,dev,inanduk.crumbbakeryis the name the bakery registered undercom. Together,crumbbakery.comis its domain.wwworshopin front is a subdomain, a sub-name the owner creates freely, such asshop.crumbbakery.com.
You do not buy a domain forever. You rent it, usually by the year, from a registrar, which records you as the holder.
DNS records. The domain's owner publishes records that say where things live:
| Record | Answers | Example value |
|---|---|---|
A |
the IPv4 address | 203.0.113.10 |
AAAA |
the IPv6 address | 2001:db8::10 |
CNAME |
"this name is an alias of that name" | shop → crumb.shops.example.net |
MX |
which server receives email | mail.crumbbakery.com |
The lookup. When the browser needs the address, it first checks caches (its own, then the operating system's). On a miss, it asks a recursive resolver, usually run by the internet provider or a public service. The resolver does the legwork:
- It asks a root server: "who handles
.com?" - It asks the
.comTLD server: "who handlescrumbbakery.com?" - It asks that domain's authoritative server: "what is the
Arecord forcrumbbakery.com?"
Every answer carries a TTL (time to live), the number of seconds it may be cached. Caching makes repeat lookups instant, and it is also why a changed record can take a while to reach everyone.
The shortcut
Think of the lookup as asking for directions from the top down: root knows the TLDs, the TLD knows the domains, the domain's own server knows the exact address. Each step only knows the next step.
Check the caches
The browser and the operating system have no stored answer, so they ask the recursive resolver.
The trap: after changing a record, people panic when some visitors still see the old site. Usually nothing is broken; old answers are simply cached until their TTL runs out.
Drills
Answer fast — trust the rule.
In blog.crumbbakery.com, which part is the subdomain?
Which record type maps a name straight to an IPv4 address?
In what order does a recursive resolver ask servers on a fresh lookup?
The bakery moves to a new server and updates its A record, but some visitors still reach the old one for a few hours. Why?
Remember
- DNS turns a name people remember into an address computers can route.
- Top-down directions: root, then TLD, then the domain's authoritative server.
- Trap: a changed record is not broken, just cached until its TTL expires.
