Common DNS Mistakes That Break Websites and Email
Spot the record errors that most often take down sites and mail, learn how each shows up and use simple checks to prevent them.
Key takeaways
- The most frequent errors are naming mistakes, conflicting record types and records forgotten during a provider change.
- A CNAME cannot share a name with other records, which rules it out at the bare domain.
- A domain should publish exactly one SPF record, and its MX targets must be real hostnames with address records.
- Querying your authoritative servers after every edit catches most problems before users do.
Most DNS outages come from a short list of ordinary errors: a name typed into the wrong field, two records that can't coexist, a mail setting left behind after a provider change or a domain that quietly expired. Each one is easy to prevent once you know what it looks like.
This guide goes through the usual suspects, shows the symptom each produces and gives you a way to confirm it. Examples use example.com and documentation addresses, so substitute your own.
Names that get your domain added twice
Zone files treat a name without a trailing dot as relative to the zone, and many control panels follow the same rule. If you enter www.example.com in the name field of a panel that appends the domain itself, you create www.example.com.example.com.
The same happens to targets. A CNAME pointing to host.provider.example without the final dot may become host.provider.example.example.com.
The symptom is simple: you're sure you added the record, yet the lookup returns nothing. Check what's served.
dig @ns1.example.com www.example.com +noall +answer
dig @ns1.example.com www.example.com.example.com +noall +answer Most panels use @ or an empty name field for the bare domain. Read the preview line your provider shows, if it has one.
CNAME conflicts
A CNAME says that one name is an alias for another. The standards require that a name with a CNAME have no other ordinary data. That produces two common errors.
The first is adding a CNAME at the bare domain. The bare domain must carry SOA and NS records, and usually MX and TXT too, so a true CNAME there is invalid. If a provider asks for it, use the provider's address records, or your DNS host's alias or flattening feature. The apex domain problem has the details.
The second is adding a TXT or MX record to a name that already has a CNAME. Some panels block it. Others accept it and then behave unpredictably.
Also avoid long chains of aliases. Each hop is another lookup and another thing that can break, and loops cause outright failure.
Missing or mismatched address records
A website can fail for some visitors only. Two typical causes involve addresses.
One is a stale AAAA record. You move the site, update the A record and forget IPv6. Visitors with IPv6 may still be sent to the old server, or to nothing. Either update the AAAA record or remove it until the new server supports IPv6.
The other is covering only one of example.com and www.example.com. People type both. Create records for both names, give each a valid certificate and redirect one to the other on the web server.
Leftover records matter too. If a name has two A records and one server is gone, some connections will be slow or fail. A and AAAA records explains how clients choose among multiple addresses.
MX records that point to the wrong thing
Mail delivery depends on MX records naming the servers that accept mail for your domain. Several mistakes recur.
- An IP address as the target. MX must name a host, which then has A or AAAA records.
- A target that is a CNAME. The standards say it shouldn't be, and some senders will fail.
- Old entries left behind after switching providers, so some mail still lands at the previous service.
- Priorities reversed. A lower number is preferred.
- No MX at all because the website was moved and the mail records weren't copied.
If a domain should never receive mail, you can publish a "null MX" record, with priority 0 and a single dot as the target, defined in RFC 7505. See MX records.
SPF, DKIM and DMARC errors
These TXT-based records help receivers judge whether mail from your domain is genuine. Small mistakes can send legitimate mail to spam or get it rejected.
Two SPF records. A domain must publish only one record beginning v=spf1. If a new service tells you to add SPF, merge its include into your existing record.
v=spf1 include:mail.example.net include:news.example.org -all Too many lookups. SPF limits the number of mechanisms that trigger DNS lookups to 10. Stacking many includes can exceed it and produce a permanent error.
Broken DKIM keys. A long public key pasted with extra quotes, spaces or a missing character fails verification. DKIM records live at a name like selector1._domainkey.example.com.
DMARC in the wrong place. It belongs at _dmarc.example.com, not at the bare domain. Turning on a strict reject policy before every legitimate sender passes can cost you real mail.
SPF explained and DMARC explained show how to build them up safely.
Symptoms and likely causes
| What you see | Likely DNS cause | First check |
|---|---|---|
| Site fails for some people only | Stale AAAA or second A record | Query both A and AAAA |
www works, bare domain does not | Missing apex record | Query the apex address |
| Incoming mail bounces | Missing or wrong MX | Query MX and its targets |
| Outgoing mail goes to spam | SPF, DKIM or DMARC errors | Inspect TXT records and message headers |
| Everything fails at once | Expired domain, wrong name servers or DNSSEC | Check registration and delegation |
| Certificate cannot be issued | CAA record excludes the issuer | Query CAA |
Delegation and name server mistakes
The registrar holds the list of name servers for your domain. If that list is wrong, nothing else matters.
Editing records at a provider that isn't listed there is a very common time-waster. You change values, save them and nothing happens, because the world is asking a different service. Check which servers are delegated.
dig example.com NS +trace Other errors include listing a server that doesn't host the zone, mixing servers from two providers whose records differ and relying on a single name server or a single network. NS and SOA records explains the delegation.
DNSSEC left half-finished
DNSSEC signs your zone, and the registry holds a DS record that vouches for your key. If the two stop matching, validating resolvers return SERVFAIL for the entire domain. This typically happens after changing DNS providers without removing the old DS record first.
The signature of this failure is that some users reach you and others can't, depending on whether their resolver validates. Fix or remove the DS record at the registrar. DNSSEC explained covers the safe order.
Registration and certificate traps
An expired domain takes the website and mail with it. Turn on automatic renewal, keep the payment card current and make sure renewal notices go to an address that doesn't depend on the same domain. Otherwise the warning about expiry may be undeliverable. Expiration and grace periods describes what happens next.
CAA records tell certificate authorities who may issue certificates for your domain. If you add one and later switch certificate providers, issuance and renewal fail until you update it. See CAA records.
TTL and testing mistakes
Two timing errors cause avoidable pain. The first is making a major change while TTLs are long, so a mistake persists for hours even after you correct it. The second is testing a name before creating it, which leaves a cached "does not exist" answer in your resolver. Plan changes as described in lowering TTL before a cutover.
A third is forgetting a test entry in a hosts file, so you see a working site that nobody else can reach, or the reverse.
Wildcards that answer too much
A wildcard record, written *.example.com, answers for any name that isn't defined otherwise. It's convenient for services that create subdomains automatically. It also hides typos, since a misspelled name resolves anyway, and it can make mail or verification checks behave in surprising ways.
Wildcards have a subtlety. Once a specific name exists with any record, the wildcard no longer applies to that name for other types. If you add only a TXT record at app.example.com, a lookup for its address returns nothing, even though the wildcard used to supply one. Use wildcards when you need them, and add explicit records for the names that matter.
Private addresses in public DNS
Publishing an address such as 192.168.1.10 in a public record works only for people on a network where that address means your machine. Everyone else reaches nothing, or an unrelated device on their own network. Some resolvers and routers also discard such answers on purpose to block a type of attack on home networks.
For names that should work only inside, use internal DNS. For names that must work from outside, publish the public address and handle the path into your network deliberately. Public and private IP addresses explains which ranges are which.
A habit that prevents most of these
Add a periodic review as well. Once or twice a year, read through every record and ask what it's for. Records pointing at services you've canceled should go, both for tidiness and because they can be abused, as covered in dangling DNS and subdomain takeover.
If you're already down
Don't make several guesses at once. Check, in order, that the domain is registered and not on hold, that the delegated name servers are the ones you expect, that those servers return your records and that DNSSEC isn't rejecting them. Only then look at individual records. Restore your saved copy if a recent edit is the suspect, and remember that the fix reaches users as their cached copies expire.