What Is DNS? Resolution, Record Types, TTL & Troubleshooting

The internet's phone book, explained properly: how a domain name becomes an IP address, what each record type does, what TTL really controls, and how to fix it when a site won't load.

📂 Web & Internet ⏱ About 12 minutes 📶 Intermediate 🛠️ Pairs with: URL Encoder

What you will learn

  • Explain what DNS does in one sentence — and why the internet needs it
  • Follow a lookup from your browser to the authoritative nameserver
  • Read the record types that run websites and email (A, CNAME, MX, TXT…)
  • Use TTL correctly so changes go live when you expect them to
  • Diagnose the five most common DNS failures yourself
In this guide
  1. What DNS actually is
  2. How a lookup works, step by step
  3. Record types: the ones that actually matter
  4. TTL: the number that controls “propagation”
  5. Why DNS matters beyond websites
  6. Troubleshooting DNS like a professional
  7. Common mistakes
  8. Try it: URL Encoder
  9. Frequently asked questions

What DNS actually is

DNS — the Domain Name System — is the internet's phone book. Computers talk to each other using IP addresses such as 104.21.33.12, but humans remember names such as veryusefultools.com. DNS is the system that translates a name into an address, every time you open a website, send an email, or an app calls an API.

Without DNS you would have to type numbers for every site you visit. With DNS, you type a name and the lookup happens invisibly, usually in a few dozen milliseconds. It is one of the oldest parts of the internet — and one of the most load-bearing: when DNS breaks, everything that depends on names breaks with it, even though the websites themselves are fine.

A useful mental model: a domain name is like a person's name in your contacts, the IP address is their phone number, and DNS is the contacts app that looks the number up. Your device does not memorise every number — it asks, gets an answer, and (importantly) remembers it for a while. That remembering is called caching, and it is where most DNS confusion comes from.

How a lookup works, step by step

When you type veryusefultools.com into a browser, this happens — in order:

  1. Your device checks its own cache

    Browser cache, then the operating system's cache. If the answer was looked up recently and is still fresh, the lookup ends here — this is why a site sometimes works again seconds later with no real fix.

  2. Your device asks a recursive resolver

    Usually run by your internet provider, or a public one such as 1.1.1.1 (Cloudflare) or 8.8.8.8 (Google). The resolver does the legwork on your behalf.

  3. The resolver asks the root servers

    “Who handles .com?” The root servers do not know the final answer — they point to the servers for the top-level domain.

  4. The TLD servers point to the authoritative nameserver

    The .com servers answer: “veryusefultools.com is handled by these nameservers.” Those are the servers your domain's DNS records live on.

  5. The authoritative nameserver gives the answer

    It returns the A record: the IP address. The resolver hands it to your browser, and the browser finally connects to the web server.

Each step caches its answer, so the next lookup for the same name is much faster — a resolver that already knows where .com lives skips straight to step 4. This chain is also why “DNS propagation” is really just caches expiring at different times around the world, not a single switch flipping.

Record types: the ones that actually matter

A DNS zone is a list of records. Each record has a type, a name, a value, and a TTL. These are the types you will meet in practice:

TypeWhat it doesExample
ADomain name → IPv4 address@ → 104.21.33.12
AAAADomain name → IPv6 address@ → 2606:4700:3031::ac43:210c
CNAMEOne name is an alias of another namewww → veryusefultools.com
MXWhich servers receive email for the domain@ → mail.example.com (priority 10)
TXTFree-form text — used for verification & email securitySPF, DKIM, DMARC records
NSWhich nameservers are authoritative for the domain@ → olof.ns.cloudflare.com
SOAStart of Authority — zone metadata (admin, serial, timers)One per zone, auto-generated
PTRReverse lookup: IP address → nameUsed by mail servers to check senders
CAAWhich certificate authorities may issue TLS certificates0 issue "letsencrypt.org"

Two rules of thumb: A/AAAA records point at numbers, CNAME records point at names — and a name that has a CNAME cannot have any other records alongside it. That second rule is why you cannot put a CNAME on the bare domain (@, the “apex”): the apex must also hold SOA and NS records, so providers offer ALIAS/ANAME records instead, which behave like a CNAME but resolve to an IP behind the scenes.

TTL: the number that controls “propagation”

TTL (time to live) is the number of seconds a resolver is allowed to cache an answer. A record with TTL 3600 may be served from cache for up to an hour after you change it — so during that hour, different people see the old and the new address. That is all “propagation” is: caches expiring.

This has one very practical consequence: lower the TTL before you change anything important. If you plan to move a site to a new server on Friday, set the TTL to 300 (5 minutes) on Monday. By Friday every cache holds at most a 5-minute-old answer, and the switch is effectively instant. Leave TTL at 86400 (24 hours) and a mistake takes a day to wash out.

Don't believe “DNS takes 48 hours”. With a low TTL, changes are visible worldwide within minutes. The 24–48 hour figure is a leftover from an era of long default TTLs — and from resolvers that ignore low TTLs, which some ISPs still do.

Short TTLs are not free: every cache miss means a fresh lookup, so extremely low TTLs (under 60 seconds) add latency and load. A common setup is 300–3600 seconds for records that change, and 86400 for records that almost never do, such as MX.

Why DNS matters beyond websites

DNS is not only about opening websites. Email depends on it completely: MX records route your mail, and TXT records carry SPF, DKIM and DMARC — the three mechanisms that let receiving servers tell real mail from spoofed mail. A missing or wrong SPF record is one of the most common reasons legitimate mail lands in spam.

It also shapes performance and security. CDNs return different IP addresses depending on where you are, so DNS quietly routes you to the nearest server. And because DNS was designed without security, its answers can be spoofed on untrusted networks — which is why DNSSEC (cryptographic signatures on records), DNS over HTTPS (DoH) and DNS over TLS (DoT) exist. If you use public Wi-Fi, a resolver that supports DoH or DoT stops the network operator from seeing and tampering with your lookups.

Troubleshooting DNS like a professional

When a site won't load, check DNS before blaming the site. On any computer you can query DNS directly:

nslookup veryusefultools.com
# or, with more detail:
dig veryusefultools.com +short
dig veryusefultools.com MX +short
# check what the rest of the world sees:
dig @1.1.1.1 veryusefultools.com +short

Read the result like this:

  1. NXDOMAIN — the name does not exist

    Typo in the domain, or the domain expired / was never registered. Nothing else to fix until the name exists.

  2. No answer / SERVFAIL

    The nameservers are down or misconfigured. Check the domain's NS records point at a provider that is actually serving the zone.

  3. Old IP address

    Stale cache. Wait out the TTL, or switch to a public resolver (1.1.1.1 / 8.8.8.8) to see the fresh answer and confirm the change itself is correct.

  4. Works on your phone, not your laptop

    Different networks, different resolvers, different caches. Flush the local cache (ipconfig /flushdns on Windows, sudo dscacheutil -flushcache on macOS) and try again.

  5. Website loads but email doesn't

    Website and email are separate records. A site migration that rewrites the whole zone often deletes MX records by accident — check them first.

Common mistakes

  • Putting a CNAME on the apex. It breaks the zone — use the provider's ALIAS/ANAME record instead.
  • Changing records without lowering TTL first. Then waiting a day wondering why nothing changed.
  • Confusing the registrar, DNS hosting, and web hosting. Three separate jobs: the registrar owns the name, DNS hosting serves the records, web hosting serves the site. They can be three different companies.
  • Deleting MX/TXT records during a “cleanup”. Email stops and spam filters start rejecting you.
  • Assuming DNS is private. Plain DNS queries are visible to your network — use DoH/DoT if that matters to you.

Try it: URL Encoder

Every web address starts with a domain name — paste a URL into the URL Encoder to see the domain, path and query string separated, then remember: DNS is the step that turns that name into an IP address.

Open the URL Encoder →

Keep learning

Frequently asked questions

What's the difference between a domain registrar, DNS hosting and web hosting?

The registrar is where you buy and renew the name. DNS hosting is the nameservers that answer lookups for it. Web hosting is the server that sends the website files. One company can do all three, but they are separate jobs — moving your website to a new host only requires changing an A record, not moving the domain.

How long do DNS changes really take?

As long as the TTL on the old record — often 5 minutes to 1 hour with modern settings. If a change seems stuck after the TTL has passed, the new record itself is probably wrong, or a resolver is ignoring the TTL.

What are 1.1.1.1 and 8.8.8.8?

Public DNS resolvers run by Cloudflare and Google. You can point your device at them instead of your ISP's resolver — they are usually faster, and both support encrypted DNS (DoH/DoT). Changing your resolver is a setting on your device or router, not on the domain.

Is DNS secure?

Classic DNS is not encrypted or authenticated, so answers can be spoofed on a network you don't control. DNSSEC adds signatures so tampered answers can be detected, and DoH/DoT encrypt the query itself. Both help; neither is universal yet, so treat DNS as untrusted on public Wi-Fi.

Why does a site work on my phone but not my laptop?

Different networks use different resolvers with different caches — one has the fresh answer, the other still holds the old one. Wait out the TTL, flush the local cache, or temporarily switch resolvers to confirm.