DNS changes that silently break email
Updated ยท Published
Mail rarely breaks on the day you set it up. It breaks months later, when someone changes DNS for another reason: a new tool, a cleanup, a move to another DNS provider or mail provider. There is often no error anyone sees. Messages go to spam, or are refused by receivers that enforce DMARC, and the first sign is a customer asking where their invoice went. These are the four changes behind most of it.
Each section links to Lookproof's page for the exact finding, which explains the error and the fix in detail. This guide is about how the change happens and how to catch it.
1. A new SPF include pushes you over the lookup limit
How it happens: someone adds include: for a new tool. SPF allows at most 10 terms that need a DNS lookup (include, a, mx, ptr, exists and redirect, counted through nested includes too). At 11, SPF returns a permanent error, and that is a fail for every service that relies on SPF, not only the new one.
Why nobody notices: the record looks fine, and the tool that was added often still passes DMARC on its own DKIM. The services that break are the old ones that only had SPF. The count can also go over without any change on your side, when a provider adds a lookup inside its own include.
Related ways the same edit breaks SPF:
- SPF record needs more than 10 DNS lookups
- More than one SPF record: a second
v=spf1record added instead of editing the first. - Included domain has no SPF record: a typo in the include, or a provider that retired it.
- More than two SPF lookups returned no data: includes of services that no longer exist.
Catch it: count lookups after every SPF change with Lookproof's SPF lookup counter, and remove includes for services you no longer use.
2. DKIM records deleted in a cleanup or a DNS move
How it happens: DKIM records are CNAMEs or TXT records with names like s1._domainkey.example.com. Nobody remembers what they are for, so they are removed in a cleanup of "old records". Or the domain moves to a new DNS provider and the import misses them, or splits a long TXT key in the wrong place.
What breaks: without the key, the receiver cannot verify the signature, and DKIM fails for every message from that service. If the service's SPF is not aligned with your domain (the usual case), DMARC fails too. With p=reject, its mail is refused.
- No DKIM key for the selector: the record is gone.
- The DKIM public key is not valid base64: the key was damaged, often by a bad copy or split.
- Key for this selector is revoked:
p=left empty, which means "revoked".
Catch it: keep a list of your selectors and which service owns each. You find them in the s= tag of the DKIM-Signature header of mail from each service. A checker cannot list a domain's selectors from DNS, it can only try common names (no DKIM key under the common selectors), so check yours by name with Lookproof's DKIM check, before and after a DNS move.
3. An expired MTA-STS certificate
MTA-STS involves two kinds of certificate, and they fail differently.
The certificate on mta-sts.example.com, the web host that serves the policy file. It is often on a forgotten web server or a CNAME to a hosting service, outside the usual certificate renewal. When it expires, senders can no longer fetch the policy. Senders that already have the policy keep using it until max_age runs out. After that they deliver as if you had no MTA-STS at all. Mail still arrives, but the protection is gone, silently. Lookproof reports this as MTA-STS policy fetch failed.
The certificate on your MX hosts. With mode: enforce, senders must not deliver to an MX whose certificate is expired or does not match its name. Mail is then not delivered at all: it waits in the sender's queue and eventually bounces. Lookproof's MTA-STS check does not connect to your mail servers, so it cannot see this. Your TLS-RPT reports can: see TLS-RPT reports explained for certificate-expired and the other failure types, and publish a TLS-RPT record if you have none (no TLS-RPT record).
Catch it: put the mta-sts. host under the same automatic renewal as your other web certificates, and read TLS-RPT reports. With a hosted mail provider, the MX certificates are the provider's job; with your own mail server, they are yours.
4. A changed MX
How it happens: a move to a new mail provider, or a DNS cleanup that touches the MX records. The MX itself usually gets updated correctly. What does not get updated is everything around it:
- The MTA-STS policy. Its
mx:lines still list the old provider. Inenforcemode senders refuse to deliver to the new MX (MX host not covered by the enforced MTA-STS policy). Add the new hosts to the policy file first, then change theidin the_mta-stsTXT record so senders fetch it again, and only then change MX. - SPF and DKIM for the new provider's outgoing mail. The new provider needs its own include (if it uses your domain as return-path) and its own DKIM records. The old provider's include should go, once it no longer sends.
- MX records removed without a replacement. With no MX at all, senders deliver to the domain's own A or AAAA address, which is usually a web server (the domain has no MX records). An MX that points to a name without an address fails in the same quiet way (MX host has no A or AAAA records).
- A null MX (
MX 0 .) left behind. It says the domain receives no mail at all, and must not be combined with other MX records (null MX together with other MX records).
Catch it: after the switch, send mail to the domain from an outside mailbox, and run a full check: MX, MTA-STS coverage, SPF and DKIM for the new provider.
How long a change takes: TTL, not propagation
A DNS change is not pushed out to anyone. Each record has a TTL, the number of seconds a resolver may keep its copy before asking again. Until that time has passed, some receivers use the old record and some the new one. With a TTL of 3600 that is up to an hour. With 86400 it is a day, during which a fix looks as if it did not work and a mistake looks as if it did no harm.
- Before a planned change (new MX, new DNS provider, DKIM key rotation), lower the TTL of the records involved, and do it at least one old TTL in advance. Raise it again when the change has settled.
- Keep the old side working for at least the old TTL: the old MX host accepting mail, the old DKIM key published, the old provider's SPF include in place.
- "Not found" is cached too. If a receiver looks up a record before it exists, it may remember that the name is missing, for a time set by the zone's SOA record. So publish a DKIM key or a DMARC record first, and turn on signing or sending afterwards.
- Test against the authoritative name servers, not only your own resolver, which may hold an old copy. Lookproof's DNS TTL check shows the TTL on each record.
MTA-STS has a cache of its own on top of this: senders keep the policy file for max_age seconds, whatever the DNS TTL is.
Also worth checking after a DNS move
- The DMARC record came along: no DMARC record found, or a second one was added next to it: more than one DMARC record.
- Verification TXT records for your services, and the
_smtp._tlsand_mta-stsrecords, which are easy to miss in a manual copy.
For the checklist to follow when a new tool starts sending, see Email authentication checklist when adding a new sending service.
Senderward checks your domain's DMARC, SPF, DKIM, MX, MTA-STS and TLS-RPT every day and emails you, with the fix, when something gets worse. $7 per domain per month, 14 days free. See pricing