Skip to content

DNS basics for website owners

What nameservers, A, CNAME, MX and TXT records actually do, and how a change spreads, in plain terms.

4
Sections
2 min
Read time

DNS is the internet's address book. When someone types your domain, their device asks DNS which server to contact. Everything about your domain, from the website to email, is decided by a handful of records.

Registrar, nameservers and records

  • The **registrar** is where you bought the domain. It records which nameservers are in charge of it.
  • The **nameservers** hold the actual records (the "zone"). They may be at your registrar, your host or a DNS provider.
  • The **records** say where each service lives: the website, the mail server, verification codes.

Editing records at your registrar has no effect if the domain's nameservers point somewhere else. Always check which nameservers are active first.

The records you will meet

RecordWhat it doesExample
APoints a name to an IPv4 addressexample.com → 203.0.113.10
AAAAPoints a name to an IPv6 addressexample.com → 2001:db8::10
CNAMEMakes a name an alias of another namewww → example.com
MXSays which servers receive email10 mail.example.com
TXTFree text, used for SPF, DKIM, DMARC and verificationv=spf1 include:… ~all
NSLists the nameservers for the zonens1.example.net

Why changes take time: TTL

Every record has a TTL (time to live) in seconds. Resolvers around the world cache the answer for that long. A TTL of 3600 means a change can take up to an hour to be seen everywhere; a change of nameservers can take longer because the parent zone has its own caching.

  1. A day before a planned change, lower the TTL of the records you will edit (for example to 300).
  2. Make the change.
  3. Check it with a DNS checker from several locations.
  4. Once everything works, raise the TTL again.

Common mistakes

  • A CNAME on the root domain (example.com): most DNS providers do not allow it, and it breaks MX and other records.
  • Two SPF records: only one v=spf1 TXT record is allowed per name.
  • Forgetting email when moving a website: if you change nameservers, copy the MX and TXT records to the new zone first.