What Happens When You Type a URL and Press Enter
DNS lookups, TCP and TLS handshakes, HTTP requests, servers, and the browser's rendering pipeline. The whole journey of a web page, explained so it finally clicks.
Read →A, AAAA, CNAME, MX, TXT and NS records in plain English, why DNS changes seem slow, and the troubleshooting commands that tell you what is really going on.
Sooner or later every developer has to point a domain at a server, verify a domain for an email service, or figure out why a site works on their laptop but not their phone. All of that is DNS. It's less mysterious than it looks.
The Domain Name System is the internet's phone book. It maps names people can remember (example.com) to the information computers need, mostly IP addresses, but also mail servers, verification tokens and more.
Each domain's DNS data is managed by its authoritative nameservers, which you choose at your registrar. Everyone else asks resolvers, which cache answers. (The full request journey.)
| Record | Purpose | Example |
|---|---|---|
| A | Name → IPv4 address | example.com → 203.0.113.10 |
| AAAA | Name → IPv6 address | example.com → 2001:db8::10 |
| CNAME | Name → another name (an alias) | www → myapp.hosting.com |
| MX | Where email for the domain goes | 10 mail.provider.com |
| TXT | Free text, used for verification and email security | v=spf1 include:... ~all |
| NS | Which nameservers are authoritative | ns1.provider.com |
| CAA | Which certificate authorities may issue certificates | 0 issue "letsencrypt.org" |
A CNAME says "this name is an alias for that name," so it can't coexist with other records on the same name. The root of your domain (example.com, called the apex) always has other records like NS and usually MX, so a standard CNAME isn't allowed there.
That's why hosting platforms ask for an A record on the apex and a CNAME for www. Many DNS providers also offer a workaround called CNAME flattening, or ALIAS/ANAME records, that behaves like a CNAME at the apex.
Every record has a TTL, a number of seconds that resolvers may cache the answer. When you change a record, resolvers that cached the old value keep using it until their TTL expires.
That's all "DNS propagation" really is: caches expiring at different times around the world.
A practical trick for planned changes, like moving to a new server:
If your domain sends email, three TXT-based records decide whether it lands in the inbox:
Without them, your password resets and receipts are likely to end up in spam. (Email deliverability guide.)
Don't guess. Ask DNS directly.
# What does DNS say right now?
dig example.com A +short
dig www.example.com CNAME +short
dig example.com MX +short
dig example.com TXT +short
# Ask a specific public resolver, bypassing your local cache
dig @1.1.1.1 example.com A +short
# Ask the authoritative nameserver directly (the source of truth)
dig example.com NS +short
dig @ns1.yourprovider.com example.com A +short
# Windows equivalent
nslookup example.com 1.1.1.1
If the authoritative server shows the new value but your machine shows the old one, it's caching. Wait it out, or flush your local DNS cache. Browser-based DNS checkers that query from many locations are also handy for seeing who has the new answer.
dig against a few public resolvers.www.example.com creates www.example.com.example.com.It depends on the TTL of the old records. With low TTLs, changes reach most users within minutes. With long TTLs (often an hour to a day), some users can see old values for that long.
A CNAME can't coexist with other records on the same name, and the root domain always has NS and SOA records. Use an A record, or your provider's ALIAS or CNAME-flattening feature.
Usually an A record for the root domain (or ALIAS) and a CNAME for www, as specified by your host. If you send email, add MX, SPF, DKIM and DMARC records too.
DNS lookups, TCP and TLS handshakes, HTTP requests, servers, and the browser's rendering pipeline. The whole journey of a web page, explained so it finally clicks.
Read →There are dozens of HTTP status codes, but about fifteen cover nearly everything. What each one means, when to return it, and the mix-ups (401 vs 403, 301 vs 302) that confuse everyone.
Read →