Skip to content

What Is DNS? A Plain Explanation for Web Builders

DNS is the naming system that connects your domain to your website and email. This guide explains lookups, record types, TTL and caching in plain language.

10 min readUpdated Nov 19, 2026By XPASS Editorial Team

What Is DNS? A Plain Explanation for Web Builders

When you type a web address into a browser, your computer has no idea where that website lives. It knows names; networks only understand numbers. The Domain Name System, DNS, is the global directory that bridges the two. It runs quietly behind every page load, every email and every app that talks to the internet, and most of the time you never think about it. Then you move a website, set up business email or change hosting, and suddenly DNS is the thing that decides whether everything works.

This guide is written for people who build or manage websites and want a clear mental model rather than a textbook. You will learn what happens during a lookup, which parts of the system you control, what the common record types do, how caching and TTL affect your changes, and how to check your own domain. Along the way we point to related guides on nameservers and on A and AAAA records so you can go deeper on each piece.

What DNS actually is

DNS is a distributed, hierarchical naming system. "Distributed" means no single computer holds every answer. "Hierarchical" means names are organised like a tree, read from right to left. In www.example.com, the rightmost label com is the top-level domain, example is the domain you registered, and www is a label you created below it.

Each level of the tree is managed by a different party. A registry operates the top-level domain, a registrar sells you a name within it, and you (or your DNS provider) decide what the records under your name say. The original design is described in RFC 1034 and RFC 1035, which are still the foundation of how the system works today, even though many extensions have been added since.

A useful analogy is a phone book that is split into thousands of smaller books. You do not need to carry the whole thing. You only need to know which book to ask next, and the book for your domain is the one you control.

What a DNS record is

A DNS record is one line of data attached to a name. Each record has a name, a type, a value and a TTL. The type tells you what the value means. An A record holds an IPv4 address, an AAAA record holds an IPv6 address, an MX record names a mail server, and a TXT record holds free-form text that other systems can read. The full collection of records for your domain is called a zone.

How a lookup works step by step

Suppose a visitor types www.example.com. Here is what normally happens, in plain order.

  1. The browser asks the operating system, which checks its own small cache. If it has a recent answer, the story ends here.
  2. If not, the device asks a recursive resolver. This is usually run by the visitor's internet provider or by a public DNS service they have chosen. The resolver does the legwork on the visitor's behalf.
  3. If the resolver has no cached answer, it starts at the root servers and asks who is responsible for com.
  4. The com servers do not know the final address, but they know which nameservers are authoritative for example.com, and they say so.
  5. The resolver then asks those authoritative nameservers for www.example.com. They hold your zone and give the definitive answer, for example an IP address.
  6. The resolver returns the answer to the visitor's device and keeps a copy in its cache for the time allowed by the TTL.
  7. The browser connects to that IP address and requests the page.

The important point for site owners is step 5. Your records are only used when a resolver reaches the authoritative servers for your domain. Which servers those are is decided by the nameserver settings at your registrar, a topic covered in what a nameserver is and what changes when you switch it.

Recursive versus authoritative

These two roles are often confused. A recursive resolver asks questions on behalf of users and caches answers. An authoritative server holds the actual records for a zone and answers only for the domains it is responsible for. When you edit DNS in a control panel, you are editing the authoritative data. The visitor's resolver is not under your control, which is why caching matters so much.

Record types you will meet most often

You do not need to memorise every type. A handful cover almost all everyday work.

Type What it stores Typical use
A An IPv4 address Point a name to a web server
AAAA An IPv6 address Same, for IPv6 networks
CNAME An alias to another name Make www follow another hostname
MX Mail server names and priorities Tell the world where to deliver email
TXT Text strings Verification codes, SPF, DKIM and DMARC policies
NS Authoritative nameservers Say which servers hold the zone
SOA Zone administration data Serial number and timing values for the zone

If you are pointing a domain at a server for the first time, the record you will use most is the one explained in how an A record points a domain to a server. Its IPv6 counterpart is covered in what an AAAA record is and how it relates to IPv6.

TTL, caching and propagation

Every record carries a TTL, short for time to live, measured in seconds. It tells resolvers how long they may reuse an answer before asking again. A short TTL means changes take effect sooner but resolvers ask more often. A long TTL reduces traffic but delays changes.

People often say "DNS propagation" as if your change were slowly travelling around the world. A more accurate picture is that your change is available immediately on the authoritative servers, while caches elsewhere expire at different moments. Two visitors can therefore see different answers for a while, and both are behaving correctly.

A practical TTL routine

  • Several days before a planned move, lower the TTL on the records you will change to a few minutes.
  • Wait at least as long as the old TTL so that cached copies with the long value have expired.
  • Make the change and test it.
  • After things are stable, raise the TTL again to reduce unnecessary lookups.

Negative answers are also cached. If a resolver recently learned that a name does not exist, it may remember that for a while, which can make a brand-new record appear to be missing at first.

A worked example

Imagine you register bakery-example.com and want a simple website plus business email.

You choose a hosting service that gives you a server address, say a documentation address such as 203.0.113.10. In your DNS panel you create an A record with the name @ (meaning the bare domain) and the value 203.0.113.10, with a TTL of 3600. You add a CNAME record named www that points to bakery-example.com, so both versions of the address lead to the same site.

For email, your mail provider gives you MX records with priorities and a TXT record to prove domain ownership. You add those exactly as written. Later, they may also ask for TXT records for sender authentication, which protect your messages from being forged.

What you have just built is a small zone: one A, one CNAME, a few MX and a few TXT records. Everything else about your domain's behaviour on the internet comes from those lines plus the NS records that tell the world where to find them.

Checking DNS yourself

You do not have to guess what DNS is saying. Several simple tools show the real answers.

  • dig example.com A asks for the A record. Add +short for a compact result.
  • dig example.com MX shows the mail servers.
  • dig example.com NS shows which nameservers answer for the domain.
  • nslookup -type=TXT example.com works on Windows, macOS and Linux and shows text records.
  • You can add @8.8.8.8 style syntax in dig to query a specific resolver and compare answers between resolvers.

When you suspect a caching problem, ask the authoritative server directly. If the authoritative answer is correct but you still see an old result, the issue is a cache and it will clear when the TTL expires. If the authoritative answer is wrong, fix the record at the source.

Common mistakes and how to avoid them

Most DNS problems come from a short list of habits.

  • Editing records in the wrong place. If your nameservers point to a hosting provider, changes made in the registrar's panel have no effect. Always find out which service is authoritative first.
  • Leaving old records behind. An extra A record can send some visitors to a server you no longer maintain.
  • Typing values incorrectly. A stray space, a missing dot at the end of a hostname in some panels, or a wrong IP address are classic causes of downtime.
  • Putting a CNAME where other records must exist. A name that has a CNAME should not carry other record types, which is why the bare domain usually uses an A record instead.
  • Forgetting email records when moving hosting. Changing nameservers replaces the whole zone, so every MX and TXT record must be recreated in the new place.
  • Expecting instant results. Allow time for caches, and test from more than one network.

Limits and what to watch for

DNS is simple in concept but has limits worth knowing.

First, DNS only tells clients where to go. It does not make a server fast, secure or available. If the address it returns is down, visitors still see an error.

Second, standard DNS queries are not encrypted by default, and plain DNS records are public. Anyone can look up your A and MX records, so never put secrets in a TXT record. Extensions such as DNSSEC, described in RFC 4033, add a way to verify that answers are authentic, but they must be supported by your registrar and DNS provider and configured correctly.

Third, DNS is a shared dependency. If your authoritative DNS provider has an outage, your site and email can be unreachable even when your server is healthy. Choose a reliable provider and keep a record of your zone so you can recreate it elsewhere.

Fourth, changes can take a while to be seen everywhere. Plan for that when scheduling a migration, and avoid making several risky changes at once.

Finally, keep your domain registration current. DNS records are useless if the domain expires, because the registry will stop delegating it to your nameservers.

Summary

DNS is the directory that turns names into addresses and tells the internet where your website and email live. A lookup passes from a resolver through the root and top-level servers to your authoritative nameservers, and answers are cached according to each record's TTL. Learn the main record types, edit DNS only where your nameservers actually point, lower the TTL before a move, and test with tools such as dig. Keep records tidy, avoid putting secrets in public text records, and remember that DNS directs traffic but does not guarantee the server behind it works.

If you are ready to put these ideas into practice, you can look at the options on the domains page when you register or manage a name.

Frequently asked questions

What does DNS do?

DNS, the Domain Name System, translates human-readable names such as example.com into the numeric addresses that computers use to reach each other. It also stores other data for a domain, such as where its email should be delivered.

Why does a DNS change not show up immediately?

Resolvers around the internet keep answers in a cache for the time set by the record's TTL. Until that time passes, some visitors may still receive the old answer, so a change can look inconsistent for a while.

What is the difference between DNS and a domain registration?

A registration is your right to use a name for a period of time. DNS is the set of records that says what that name points to. You can register a domain without having any DNS records, but then nothing useful will load.

Where do I edit my DNS records?

Edit them at whichever service runs the authoritative DNS for your domain. That is usually the registrar by default, or a separate DNS or hosting provider if you changed the nameservers.

How can I check what DNS says about my domain?

Use a lookup tool such as dig or nslookup on your computer, or an online DNS checker, and ask for the record type you care about, for example A, MX or TXT.

About the author

Bob Kanokphon Thongdee, founder of XPASS VPN

Bob Kanokphon Thongdee

  • Founder of XPASS VPN
  • Co-founder of eSIMonline.asia
  • More than 7 years in online marketing
  • Founder of Cojourney Visa and Cojourney Travel

Ready to register your domain?

Search a name, compare extensions and pay once for the years you choose.

.com registration from $18.81 for the first year

Search domains

Keep reading

Domain & DNS Guides

What Is a Nameserver and What Happens When You Change It?

Nameservers decide where your domain's DNS records live. This guide explains delegation, what moves when you change them and how to switch without downtime.

10 min read

Domain & DNS Guides

What Is an A Record and How Do You Point a Domain to a Server?

An A record links a domain name to an IPv4 address. This guide explains how it works, how to point your domain at a server, and what to check when it does not resolve.

10 min read

Domain & DNS Guides

What Is an AAAA Record and How Does It Relate to IPv6?

The AAAA record is the IPv6 counterpart of the A record. This guide explains the format, when you need it, how to add it safely and how to test that IPv6 works.

10 min read