How DNS Works: A Plain-English Guide for Website Owners
Computers find each other with numbers, but people remember names. The Domain Name System (DNS) is the internet's phone book: it translates a name like example.com into the address of the server that hosts the site. You don't need to be an expert, but knowing the basics saves a lot of confusion when you set up or move a website.
The main players
Registrar. The company where you registered your domain name. You buy and renew the domain here.
DNS host. The service that holds your DNS records and answers queries about your domain. This is often your registrar, but it can be your web host or a separate provider. The domain's nameservers say who the DNS host is.
Web host. The company that runs the server holding your website files.
Email provider. The service that handles mail for your domain.
These can be the same company or four different ones. Many problems come from not knowing who controls what. See who owns your website and accounts.
What happens when someone visits your site
- The browser asks a DNS resolver for the address of your domain.
- The resolver follows the chain of DNS servers until it finds the answer from your nameservers.
- It returns the server's address to the browser.
- The browser connects to that server and loads the page.
Resolvers remember answers for a while, which is why changes aren't instant.
Common record types
| Record | What it does |
|---|---|
| A | Points a name to an IPv4 address |
| AAAA | Points a name to an IPv6 address |
| CNAME | Makes one name an alias of another name |
| MX | Says which servers receive email for the domain |
| TXT | Holds text, used for verification and email security |
| NS | Lists the nameservers for the domain |
TXT records are used for email authentication. See email for your domain: SPF, DKIM, and DMARC.
Subdomains and the root domain
The "root" or "apex" domain is example.com. A subdomain is something in front, such as www.example.com or shop.example.com. Each can have its own records. A CNAME generally can't be used on the root domain by standard rules, so hosts offer alternatives, such as ALIAS, ANAME, or flattening features.
TTL and propagation
Each record has a TTL (time to live), the number of seconds resolvers may cache it. When you change a record, some visitors see the new value quickly and others keep seeing the old one until their cached copy expires. This is often called propagation. It can take minutes or up to a day or more, depending on TTLs and where the change is made.
Tip: before a planned move, lower the TTL a day or two earlier, make the change, then raise it again afterwards.
Common DNS problems
- Records pointing to an old server after a move
- Missing www or root records, so one version of the address doesn't work
- Conflicting records
- Email stops working because MX or TXT records were deleted when switching nameservers
- A certificate that can't be issued because DNS isn't pointing correctly. See SSL and HTTPS
Keep a record of your DNS
Before changing anything, export or screenshot all existing records. It makes recovery much easier.
Security
Use strong passwords and two-factor authentication on your registrar and DNS accounts. Anyone who controls your DNS can redirect your website and email. See password managers for small teams and how to keep your website secure.
Next steps
To connect your domain to a new site, see how to point a domain to your website.
The bottom line
DNS translates names to addresses and routes email. Know where yours is managed, keep a copy of your records, and expect changes to take time to spread.