Email authentication fails after DNS change: 3 records to check first
By Daniel Brooks Published 8 min read
On this page (10 sections)
- The short version
- Email authentication fails after changing DNS records
- Why it happens
- Check 1: has DNS actually propagated?
- Check 2: are SPF, DKIM and DMARC records present and correct?
- Check 3: alignment explains many DMARC failures
- DKIM keys can be truncated during publishing
- DMARC reports show which senders still fail
- How to stop it happening again
- Questions people still ask
In short: Email authentication usually fails after a DNS change for one of three reasons: the new records have not propagated yet, a required record is missing or malformed, or alignment broke because mail is being sent through a different domain or service. Check propagation, then verify each record and alignment before changing the policy.
The record you published may be perfect and still fail. Three checks show whether DNS, syntax or alignment is responsible.
| Typical propagation | Measure it against the record's previous TTL; short TTLs often update sooner |
|---|---|
| SPF record limit | 10 DNS-query mechanisms, under RFC 7208 section 4.6.4; one SPF record |
| Recommended DMARC start | p=none while you collect reports |
| DKIM key size | 1024 or 2048-bit, according to your provider's current guidance |
| Check before edits | Free: dig, nslookup and public DNS resolvers |
The short version
- Check propagation, then record syntax and contents, then alignment.
- Wait for the TTL you set before assuming a record is broken.
- SPF should have one TXT record starting v=spf1. Multiple SPF records produce a PermError under RFC 7208.
- DKIM is checked per selector, so verify the selector your mail provider actually uses.
- DMARC fails when the From domain does not match SPF or DKIM. This is common with marketing tools.
Email authentication fails after changing DNS records
You moved hosts, switched email providers or updated a DNS record, and suddenly messages bounce with errors like "SPF fail", "DKIM signature did not verify" or "DMARC policy not satisfied". Nothing else changed, but your mail is now being rejected or dumped in spam.
Three causes account for most cases: stale DNS data, a missing or malformed record, or broken domain alignment. Test those causes in that sequence, so you do not mistake cached data for a bad record.
You can diagnose the problem with dig or nslookup on Windows, Mac or Linux. Message headers then show whether the published records worked during an actual delivery.
Why it happens
DNS changes do not apply instantly. Every record carries a TTL, or time-to-live, in seconds, and resolvers can keep serving the old value until that timer expires. If the old TTL was 3600, some servers may keep the old answer for an hour or longer. We cover restoring site and email in its own article.
A moved domain can lose an old SPF or DKIM record before the replacement is added. Manual edits can also introduce extra quotes, a wrong selector, or a missing dot.
SPF has one record and a query budget. RFC 7208 section 4.5 says multiple SPF records produce a PermError, while section 4.6.4 limits DNS-querying mechanisms to ten during evaluation.
- Propagation is still in progress, so recipients see different versions of the zone.
- A record was deleted or renamed during a host or provider move.
- Two SPF records exist. Receivers treat multiple SPF records as an error under RFC 7208.
- The DKIM selector is wrong, so the sender queries a name that does not exist.
- Alignment broke because mail now flows through a different service or subdomain.
- Quotes, line breaks or a missing dot changed the value during manual editing.
Check 1: has DNS actually propagated?
Confirm public resolvers can see the new records before diagnosing their contents. Use two resolvers and compare their answers with the value in your DNS panel. The other half of this decision is protect google account access.
- On Windows, open Command Prompt; on Mac or Linux, open Terminal.
- Run nslookup -type=TXT yourdomain.com 8.8.8.8, or dig TXT yourdomain.com @8.8.8.8.
- Repeat with 1.1.1.1 and note whether either resolver returns the old value.
- Compare the returned text with the record you entered, including its name and every value.
- Wait for the previous TTL plus a safety margin if either resolver still shows old data.
Check 2: are SPF, DKIM and DMARC records present and correct?
After public lookups return the new data, verify each record individually. Each record has a fixed DNS name and a different failure pattern.
- SPF: run dig TXT yourdomain.com @8.8.8.8 or nslookup -type=TXT yourdomain.com 8.8.8.8. Find exactly one v=spf1 answer. A normal result resembles \"v=spf1 include:_spf.example.net ~all\".
- DKIM: ask your mail provider for the selector, then run dig TXT selector._domainkey.yourdomain.com @8.8.8.8 or nslookup -type=TXT selector._domainkey.yourdomain.com 8.8.8.8. A valid result contains \"v=DKIM1; k=rsa; p=MIIB…\". Replace selector with the provider's actual value.
- DMARC: run dig TXT _dmarc.yourdomain.com @8.8.8.8 or nslookup -type=TXT _dmarc.yourdomain.com 8.8.8.8. A valid result resembles \"v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com\".
- Compare every value with the copy-and-paste string your provider gives you. Do not rely on memory.
| Record | Where it lives in DNS | What a valid answer starts with | Common failure |
|---|---|---|---|
| SPF | TXT record on the root domain | v=spf1 | Two SPF records, or more than 10 DNS-querying mechanisms |
| DKIM | TXT record on selector._domainkey.yourdomain.com | v=DKIM1 or a p= key | Wrong selector name, key truncated when pasted |
| DMARC | TXT record on _dmarc.yourdomain.com | v=DMARC1 | Published on the wrong name, or p=reject too early |
Check 3: alignment explains many DMARC failures
DMARC requires the domain in the visible From address to align with a domain that passed SPF or DKIM. Authentication can pass somewhere in the delivery chain while DMARC still fails.
Marketing and newsletter tools often use their own return-path or signing domain. SPF and DKIM may pass for those domains, while the visible From address uses yourdomain.com. We cover related admin and publishing issues in its own article.
The fix is provider-specific domain authentication. Publish the requested DKIM or return-path records, then send another test message.
How to diagnose an alignment failure
Read three header values in a failing message: the From domain, the d= domain in the DKIM signature, and the domain SPF authenticated. If the From domain matches neither authenticated domain, alignment is the problem.
Check the sending service for settings named domain authentication, custom return-path or DKIM signing. Publish its records and retest after public DNS resolvers return them.
DKIM keys can be truncated during publishing
A DKIM TXT response can contain several quoted strings. That is normal when a provider splits a long key across DNS text chunks; receivers join the chunks before checking the signature.
Truncation looks different. The response ends before the expected key, lacks the provider's final characters, or has a p= value that is visibly shorter than the supplied key. Compare the complete lookup with the provider's original value.
Edit the TXT record and paste the complete key. If your DNS editor limits line length, publish one TXT value using adjacent quoted strings, such as \"v=DKIM1; k=rsa; p=FIRSTPART\" \"SECONDPART\". Do not add spaces inside the key unless the provider supplied them.
Run the DKIM dig and nslookup commands again, confirm the full p= value is present, then send a new test. A signature created before the repair will not change.
DMARC reports show which senders still fail
The rua tag requests aggregate reports, usually as XML attachments sent to the address after rua=. These reports summarise source IPs, message counts, SPF results, DKIM results and DMARC disposition.
Open each XML file and group rows by source IP and envelope or DKIM domain. A high count with SPF or DKIM failure identifies a sender that needs authentication; a passing result with a different From domain points to alignment.
Check the disposition field too. It shows whether the receiver took no action, quarantined the message or rejected it. Keep p=none while you identify unknown sources, then tighten the policy after legitimate traffic passes.
If raw XML is difficult to read, use a DMARC report analyzer only after checking its privacy terms. You can also inspect the XML in a spreadsheet by recording source IP, count, From domain, DKIM result, SPF result and disposition.
How to stop it happening again
Most repeat failures come from editing DNS live with a long TTL. A short change plan prevents many of them.
- Lower the TTL to 300 seconds before a planned change, then restore a normal value after public lookups agree.
- Export or screenshot the DNS zone before editing, so you can restore the working state.
- Publish a new provider's SPF include and DKIM key before switching sending traffic.
- Send one test after each change and inspect its authentication headers.
Questions people still ask
How long should I wait before assuming a DNS change broke something?
Compare public lookup results with the TTL that was set before your edit. A 300-second TTL often updates within minutes; a 3600-second TTL can take an hour or longer.
Can I have two SPF records if I use two email providers?
No. RFC 7208 treats multiple SPF records as a PermError. Merge both providers into one record using include mechanisms, and keep DNS-querying mechanisms within the ten-query limit in RFC 7208 section 4.6.4.
Why does Gmail show SPF pass and DKIM pass but DMARC fail?
The authenticated domains do not align with the visible From domain. This often happens when a marketing tool has not been configured with your domain.
Is it safe to set DMARC to p=reject straight away?
Not until every legitimate sending source is aligned and passing. Start with p=none, review rua reports, then tighten the policy when the results are clean.
What free tools can I use to verify my records?
Use dig or nslookup with public resolvers. Check the DNS answers, then inspect one delivered message's Authentication-Results header.