DKIM Failures: Causes and Fixes
A DKIM fail means the receiving server could not verify the cryptographic signature on your message, and the fix depends on which of two things broke: the key published in DNS, or the message itself after it was signed. Read the Authentication-Results header first — it tells you which one you are dealing with in most cases — then work through DNS, key pairing, message modification, signing configuration and key expiry in that order. This article walks through each cause, how to confirm it, and how to fix it without guesswork.
What a DKIM failure actually looks like
DKIM signs a message by hashing selected headers and the body, encrypting that hash with a private key, and attaching the result as a DKIM-Signature header. The matching public key lives in DNS at selector._domainkey.yourdomain. The receiver recomputes the hash and checks it against the signature using the public key. If anything does not line up, you get a failure.
In practice you meet it in one of these forms:
- An
Authentication-Resultsheader showingdkim=failwith a reason string, usuallysignature verification failedorbody hash did not verify. - Gmail's "Show original" panel listing DKIM as
FAILnext to your sending domain. dmarc=failin an aggregate report, caused by DKIM and SPF both failing on the same message.- A sudden drop in inbox placement right after a DNS edit, a template change or a provider migration.
The two reason strings matter because they point in different directions. signature verification failed almost always means the key used to sign is not the pair of the key in DNS. body hash did not verify means the key is fine but the message content changed after signing. Diagnose from the header, not from the symptom.
The five causes, in order of how often they turn up
1. DNS problems
The record is missing, published under the wrong selector, has a typo in the p= value, sits on the wrong host, or has not propagated yet. A second, conflicting TXT record for the same selector is a common variant — resolvers may return either one, so verification fails intermittently.
2. Key mismatch
The private key signing your mail is not the pair of the public key in DNS. This shows up after a key rotation where DNS was updated late, or when a provider rotates keys and the record was never refreshed. It is the single most common cause of signature verification failed.
3. Message modified in transit
A mailing list, forwarding service, security gateway or mailbox rule rewrites the subject, appends a footer, strips an attachment or re-encodes the body. The signature covers the original content, so the body hash no longer matches. Senders usually blame this first; it is usually not their fault and often not fixable on their side.
4. Signing configuration errors
The wrong selector or domain is set in the sending tool, signing is disabled for a specific message type (transactional is a frequent victim), or the d= domain does not align with the From domain in a way the receiver rejects for DMARC purposes.
5. Expired or revoked key
The record carries an x= tag with a timestamp that has passed, or the key was retired but the DNS record stayed in place. Rare, but it produces a clean, permanent failure that looks mysterious until you read the record.
How to diagnose which one you have
Step 1: Pull the raw headers
Get the full message source — Gmail's "Show original", Outlook's "View message source", or the raw message from your provider's log. Find Authentication-Results and read three values: the dkim= result, the d= domain, and the selector= value. An illustrative example:
Authentication-Results: mx.example.net;
dkim=fail reason="signature verification failed"
header.d=mail.example.com header.s=mf2024 header.b="AbCdEf12";
spf=pass smtp.mailfrom=bounce.example.com;
dmarc=fail (p=NONE sp=QUARANTINE) header.from=example.com
That block tells you the selector is mf2024, the signing domain is mail.example.com, and the reason is a key-level failure, not a body hash failure.
Step 2: Look up the public key
Query mf2024._domainkey.mail.example.com for a TXT record. Confirm it exists, that the p= value is a complete key rather than a truncated one, and that there is only one record for that selector. If your DNS host splits long TXT values into multiple strings, make sure the split is syntactically valid.
Step 3: Compare the header with your configuration
The selector and d= domain in the header must match what your sending tool is configured to use. A mismatch here explains most signature verification failed cases and takes thirty seconds to spot.
Step 4: Read the reason string
If it says body hash did not verify, the key is fine. Walk the Received headers and look for a forwarder, list server or gateway between you and the recipient. That path modified the message.
Step 5: Check for expiry
Look for an x= tag in the DNS record. If it is in the past, the key is dead regardless of everything else.
Many sending platforms now surface a per-message authentication report in their logs, which saves the header hunt entirely. If yours does, start there. Our guide on checking whether SPF, DKIM and DMARC are set up correctly covers the wider verification loop.
Fixes, cause by cause
DNS fixes
Publish the TXT record at selector._domainkey.example.com, keep the full p= value intact, remove duplicate or stale records for the same selector, and wait out the TTL before retesting. If you changed the record and the failure persists, check propagation from more than one resolver — a stale cache on your own network will lie to you.
Key mismatch fixes
Regenerate the key pair in your sending tool, copy the new public key into DNS, wait for propagation, and only then start signing with the new private key. Doing it in the other order guarantees a window of failures. If your provider manages the key, confirm which selector it expects and whether you need to publish the record yourself.
Message modification fixes
If a forwarder or list is rewriting mail, you have two realistic options: accept that DKIM will break on that path and lean on SPF alignment for DMARC, or move that traffic to a subdomain you control. ARC exists precisely for the forwarding case — see ARC (Authenticated Received Chain) explained if forwarded mail matters to your deliverability. For your own templates, stop injecting content after the signing step.
Configuration fixes
Set the correct selector and domain in the sending tool, make sure the From domain aligns with the d= domain, and confirm signing is enabled for every message type you send, transactional included. Then retest by sending to a seed address and reading the headers again.
Expiry fixes
Remove or refresh the x= tag and put key rotation on a calendar so it never surprises you. Rotate on a schedule rather than in response to an incident.
Preventing the next DKIM fail
- Rotate keys on a calendar and update DNS before switching the signer. Never the other way round.
- Keep a staging subdomain for template and header changes, so a broken signature never reaches your main domain.
- Avoid tools that append footers or tracking pixels after signing. If you need a footer, put it in the template before sending.
- Monitor authentication results continuously, not only when a campaign underperforms. A weekly look at
dkimanddmarcpass rates catches drift early. - Keep SPF and DMARC aligned with DKIM so a single failure does not sink the message. If you are still assembling the stack, what SPF is and how it works is the right starting point.
Mailerflow handles part of this for you: own-domain sending with guided DKIM, SPF and DMARC setup and automatic verification, plus reputation monitoring and warm-up limits. The practical difference is that verification happens during setup rather than after a campaign has already underperformed.
When to stop debugging and ask your provider
Some failures are not yours to fix. Contact your ESP or DNS host when:
- The public key in DNS does not match anything your tool generated.
- Your provider signs with a selector you cannot see or edit.
- The failure affects only one message type — transactional but not campaigns, for example.
- The failure started without any change on your side.
Include the raw headers, the selector and d= domain, the timestamp, and whether the failure is constant or intermittent. Intermittent failures usually point to forwarding or to multiple sending paths rather than a broken key, and that detail saves a round trip.
FAQ
Does a DKIM fail mean my email will be rejected?
Not by itself. A DKIM failure combined with an SPF failure and no DMARC alignment hurts placement and can trigger rejection at strict receivers, but DKIM alone is one signal.
Can I have DKIM pass and still land in spam?
Yes. Authentication proves the message is yours and unmodified; it says nothing about whether recipients want it. Engagement, complaint rates and list hygiene still drive placement.
Why does DKIM pass for some recipients and fail for others?
Forwarding and mailbox-provider rewriting. The message arrives intact at some inboxes and modified at others, so the body hash verifies in one case and not the other.
Do I need DKIM if I already have SPF?
They cover different things. SPF authorises sending IPs; DKIM proves content integrity. DMARC alignment works best when both pass, and receivers weight them together.
How long do DNS changes take?
It depends on the TTL on the record, often minutes but plan for the full TTL value. Lower the TTL before a planned rotation so the change propagates quickly.
Once your signature verifies reliably, the next step is usually the visible layer — BIMI and showing your logo in the inbox builds directly on a working DKIM and DMARC setup.
Set up your sending domain in Mailerflow with guided DKIM, SPF and DMARC and automatic verification.


