A domain name on its own does nothing. It becomes useful because of the small entries stored behind it, called DNS records, that say where the website lives, who receives the email and which services are allowed to speak for you. There are a couple of dozen record types in existence, but a normal website only ever touches about eight of them.
Here's what each one does, what it looks like, and the slip-ups that tend to cause trouble.
A zone file in one glance
Everything below lives in a "zone", which is just the list of records for one domain. Here's a realistic small one:
example.com. 3600 IN A 203.0.113.10 example.com. 3600 IN AAAA 2001:db8::10 www 3600 IN CNAME example.com. example.com. 3600 IN MX 10 mail.example.com. example.com. 3600 IN TXT "v=spf1 mx -all" example.com. 86400 IN NS ns1.provider.net.
Each line has a name, a TTL (how long resolvers may remember it), the class IN (always Internet), the record type and the value. Let's go through the types.
A and AAAA: the address records
An A record maps a name to an IPv4 address, the familiar four-number kind. An AAAA record does the same for IPv6. These are the records that actually send browsers to your server. It's fine, and common, to have several A records for one name; resolvers hand them out in rotating order, which gives you cheap load spreading.
If you publish an AAAA record, make sure your server really answers on IPv6. A broken IPv6 address is a classic cause of "works for me, fails for them", because some visitors try it first.
CNAME: an alias, not a redirect
A CNAME says "this name is another name for that one". The www line above sends www.example.com wherever example.com goes. It's popular with CDNs and SaaS tools because the provider can change their IP addresses without you touching anything.
Two rules trip people up. A name with a CNAME can't have any other record type beside it, and for historical reasons the bare domain (the apex) can't be a CNAME, because it must also carry NS and SOA records. Some providers get around that with "CNAME flattening" or an ALIAS record, which is a proprietary feature rather than a standard.
MX: where email goes
An MX record names a mail server and a priority. The lower number is tried first, which feels backwards until you think of it as a rank. Real-world example: Gmail's domain publishes five, from priority 5 for gmail-smtp-in.l.google.com up to 40, so mail still arrives if the first few are busy. An MX target must be a hostname with its own A or AAAA record. It can't be an IP address, and it shouldn't point at a CNAME.
TXT: the junk drawer that runs your email security
A TXT record holds free-form text. In practice it carries three kinds of data: proof you own the domain (Google Search Console, Microsoft 365 and others ask for this), email authentication (SPF, DKIM, DMARC) and various service settings. A domain can have many TXT records, but only one SPF record, and publishing two is a very common mistake that makes both fail. Our guide to SPF, DKIM and DMARC goes deeper.
NS: who is in charge
The NS records name the authoritative nameservers for the domain, the servers that hold the real answers. They exist twice: once at your DNS provider and once at the registry, in the parent zone. If those two sets disagree, you get odd, intermittent failures. Changing them is the riskiest edit you can make, so read how to change nameservers without downtime first.
SOA: the zone's paperwork
Every zone has exactly one SOA (start of authority) record. For example.com we got:
example.com. 1800 IN SOA elliott.ns.cloudflare.com. dns.cloudflare.com. 2420077714 10000 2400 604800 1800
After the primary server and the admin contact comes the serial number, which should rise with every change, then the refresh, retry and expire timers for secondary servers. The final number, 1800 here, is the negative-caching time: how long resolvers remember that a name does not exist.
The rest of the cast
- CAA lists which certificate authorities may issue SSL certificates for your domain. It's a cheap safeguard against mis-issued certificates.
- SRV points to a service on a specific host and port, as used by Microsoft 365, SIP phones and some chat systems.
- PTR works backwards, from an IP address to a name. It's managed by whoever owns the IP, and matters for email. See reverse DNS for the details.
Mistakes worth avoiding
- Forgetting the trailing dot. In a raw zone file,
mail.example.comwithout a final dot gets your own domain stuck on the end, producingmail.example.com.example.com. Many control panels hide this, but not all. - Putting a CNAME next to other records. It breaks mail or verification in ways that look random.
- Two SPF records. Merge them into a single line.
- TTLs that are too long before a change. A 24-hour TTL means up to a day of stale answers. See DNS TTL explained.
- Assuming "ANY" shows everything. Most servers now return only a small subset for ANY queries, so ask for each type separately.
Seeing what your domain really publishes
Don't trust the control panel alone. Look at what the world actually receives. Enter your domain in our DNS checker, pick a record type and compare the answers across resolvers. If they all agree, you're done. If they don't, the TTL beside each answer tells you roughly how long the wait will be, which our guide to DNS propagation time explains in more detail.