Advertisement
Skip to content

Email authentication fails after DNS change: 3 records to check first

By Published 8 min read

On this page (10 sections)
  1. The short version
  2. Email authentication fails after changing DNS records
  3. Why it happens
  4. Check 1: has DNS actually propagated?
  5. Check 2: are SPF, DKIM and DMARC records present and correct?
  6. Check 3: alignment explains many DMARC failures
  7. DKIM keys can be truncated during publishing
  8. DMARC reports show which senders still fail
  9. How to stop it happening again
  10. 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.

At a glance
Typical propagationMeasure it against the record's previous TTL; short TTLs often update sooner
SPF record limit10 DNS-query mechanisms, under RFC 7208 section 4.6.4; one SPF record
Recommended DMARC startp=none while you collect reports
DKIM key size1024 or 2048-bit, according to your provider's current guidance
Check before editsFree: 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

email authentication fails after changing dns records - Email authentication fails after changing DNS records
Email authentication fails after changing DNS records

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.

  1. On Windows, open Command Prompt; on Mac or Linux, open Terminal.
  2. Run nslookup -type=TXT yourdomain.com 8.8.8.8, or dig TXT yourdomain.com @8.8.8.8.
  3. Repeat with 1.1.1.1 and note whether either resolver returns the old value.
  4. Compare the returned text with the record you entered, including its name and every value.
  5. 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?

Person at a laptop comparing two DNS record panels side by side
Person at a laptop comparing two DNS record panels side by side

After public lookups return the new data, verify each record individually. Each record has a fixed DNS name and a different failure pattern.

  1. 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\".
  2. 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.
  3. 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\".
  4. Compare every value with the copy-and-paste string your provider gives you. Do not rely on memory.
What each record should look like and how to check it
RecordWhere it lives in DNSWhat a valid answer starts withCommon failure
SPFTXT record on the root domainv=spf1Two SPF records, or more than 10 DNS-querying mechanisms
DKIMTXT record on selector._domainkey.yourdomain.comv=DKIM1 or a p= keyWrong selector name, key truncated when pasted
DMARCTXT record on _dmarc.yourdomain.comv=DMARC1Published 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

Terminal window showing a TXT record lookup result
Terminal window showing a TXT record lookup result

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.

I have lost count of how many broken migrations turned out to be a DKIM selector published under the wrong name or a second SPF record added during a merge.