When someone types your domain name, their computer has to find out which server to talk to. That lookup is the job of the Domain Name System (DNS), often called the phone book of the internet. Our page on domain nameservers explains who answers those questions; this page explains the answers themselves: the DNS records.
The records you will meet
| Record | What it does | Example value |
|---|---|---|
| A | Points a name to an IPv4 address | 203.0.113.10 |
| AAAA | Points a name to an IPv6 address | 2001:db8::10 |
| CNAME | Makes a name an alias of another name | www → example.com |
| MX | Says which servers receive email, with a priority | 10 mail.example.com |
| TXT | Free text, used for verification and email security | v=spf1 include:… -all |
| NS | Lists the nameservers for the domain | ns1.provider.net |
| CAA | Limits which certificate authorities may issue certificates | 0 issue "letsencrypt.org" |
| SRV | Points to servers for specific services | Used by calling and chat apps |
A typical small-business setup
example.com. 3600 A 203.0.113.10
www.example.com. 3600 CNAME example.com.
example.com. 3600 MX 10 mx1.mailprovider.net.
example.com. 3600 MX 20 mx2.mailprovider.net.
example.com. 3600 TXT "v=spf1 include:_spf.mailprovider.net -all"
_dmarc.example.com. 3600 TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com"The website runs on one server, email is handled by a mail provider, and two TXT records protect the domain against email spoofing. Our guide to SPF, DKIM and DMARC explains those in detail.
TTL: why changes are not always instant
Every record has a TTL (time to live) in seconds. Resolvers around the world keep the answer in their cache for that long. With a TTL of 86400 (one day), some visitors may reach your old server for up to a day after a change. Before a planned move – see changing web hosts – lower the TTL to 300 seconds a day in advance, make the change, and raise it again afterwards.
Changing DNS without breaking things
- Take a screenshot or export of all existing records before you change anything.
- When you change nameservers, recreate every record at the new provider first – forgotten MX records are the classic cause of lost email.
- Check the result with a lookup tool or the
dig/nslookupcommand before and after. - Consider DNSSEC, which signs your records so they cannot be forged. Many registrars can enable it with one click.
Frequently asked questions
How long does a DNS change take?
Resolvers cache records for the TTL (time to live) of the record, often one hour to one day. Lowering the TTL a day before a change makes the switch almost instant for most visitors.
Can I put a CNAME on my root domain?
Not according to the DNS standard, because the root already has other records. Many DNS providers offer a workaround called ALIAS, ANAME or CNAME flattening.