
You publish a DKIM record. You wait. You test. Still failing. So you publish it again, maybe with a slightly different name. Still failing.
Here's what usually explains it: you were checking the wrong key. There's no single "DKIM record" for your domain. Every signed email names its own key, and if you're not reading that name from the actual failing email, you're guessing.
This guide shows you how to find the DKIM selector in a real email, look up the exact key that receiver checked, and work out which of four very different problems you actually have. Only one of them is fixed in DNS.
There's No Such Thing as "Your DKIM Record"
This is the misunderstanding at the root of most DKIM headaches.
DKIM public keys don't live at one fixed address. Each signature carries two values:
- d= the signing domain
- s= the selector (a label that picks which key to use)
Together they make the lookup address: selector._domainkey.signing-domain.
So if an email's signature says d=yourbusiness.co.uk and s=mail2026, the receiver looks up:
mail2026._domainkey.yourbusiness.co.ukYour domain can have many selectors at once: one for Microsoft 365, one for your newsletter platform, one for your invoicing tool, maybe an old one from last year's key rotation.
That's why querying "default._domainkey" out of habit can give you a perfect, valid answer for completely the wrong key. RFC 6376 defines this whole selector mechanism.
How to Find the DKIM Selector in an Email Header
Open the full original of a failing email:
- Gmail: open the message, click the three dots, choose "Show original"
- Outlook: open the message, then look for "View message source" or "Message details" (the exact name varies by version)
Search for "DKIM-Signature". You'll see something like:
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=yourbusiness.co.uk; s=mail2026;
h=from:to:subject:date:message-id;
bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=;
b=AuUoFEfDxTDkHlLXSZEpZj79LICEps6eda7W3deTVFOk...Copy these:
- d= (signing domain)
- s= (selector)
- a= (algorithm)
- c= (canonicalisation, which we'll come back to)
- h= (the list of signed headers)
- bh= (the body hash)
Also note the receiver's DKIM result and any reason text, plus which application sent it, the UTC time and the message ID.
Do this before editing anything in DNS.
Use the Result Your Own Server Added, Not One That Came Along for the Ride
Find the Authentication-Results line in the same header. RFC 8601 defines this field, including an identifier that tells you which server did the checking.
Only trust the line your receiving service added. Emails can carry similar-looking lines from earlier servers or even from the sender. They're not proof.
Copy the exact result. Here's why it matters, because "DKIM failed" covers several very different situations:
- none: no signature was found (or none was evaluated)
- fail: a signature was found but didn't verify
- temperror: a temporary problem, often DNS lookup trouble
- permerror: a permanent problem, often a malformed key record
- policy: the signature was rejected by local policy
A missing key, a malformed record, a revoked key, a changed message body and a broken signature all need different fixes, and different people fix them.
Emails can also carry several signatures. Match each result to its domain and selector. Don't delete all your DKIM records because one of two signatures failed.
Keep the full header private. If you can't get a trusted receiver result, send one controlled test message before touching production.
Look Up the Exact Key the Receiver Tried to Use
With d= and s= in hand, query the TXT record at the exact name.
On Mac or Linux:
dig +short TXT mail2026._domainkey.yourbusiness.co.ukOn Windows:
nslookup -type=TXT mail2026._domainkey.yourbusiness.co.ukOr use Google Admin Toolbox Dig in your browser.
Record the resolver, the UTC time, any CNAME chain, the TXT answer and the TTL. If you suspect caching or delegation issues, also query your domain's authoritative nameserver directly.
Watch out for these classic traps:
- Double domain names. Many DNS panels add your domain automatically. If you typed the full name, you may have created mail2026._domainkey.yourbusiness.co.uk.yourbusiness.co.uk
- CNAME delegation. If the selector is a CNAME pointing to your provider, follow it and check the target answers. Don't replace it with a guessed TXT record
- Split strings. Long keys are often shown as several quoted chunks. They're one key. Join them as your DNS client does
Problem One: The Key Is Missing, Broken or Out of Date
No answer at all can mean:
- The record was never published
- It was published at the wrong name
- It was removed too early (while old emails were still being checked)
- Delegation problems are hiding it
Compare the exact time of the failed email with your DNS change history and TTLs. A successful lookup now doesn't prove the key existed when the receiver checked.
A record can exist but still be unusable. Check:
- The tag syntax is valid
- The key data is intact
- Any service type or hash restrictions make sense
- The key hasn't been revoked (an empty p= value means "revoked")
RFC 6376 explains how receivers interpret key records.
There's a balance with key rotation. Keep old selectors live long enough for queued and delayed mail to verify. But don't leave abandoned keys forever, because they become unmanaged clutter. Use distinct selectors, record when each was activated and retired, and only delete one when you're confident old mail has cleared.
Problem Two: The Key Is Fine, but Nothing Is Signing
This is the "dkim=none" case, and it fools a lot of people.
A correct public key in DNS doesn't make anything sign. It's like having a stamp made but never using it.
If the receiver reports dkim=none, the sending route probably never added a signature. Publishing more keys won't help.
Instead:
- Find the actual application or relay that sends this mail
- Enable DKIM signing in that system
- Check it covers this feature, this From domain and this account
- Complete any separate verification step the service requires after publishing DNS
Problem Three: The Signature Exists but Doesn't Match the Key
If the signature is present and the body hash matches, but cryptographic verification still fails, look at:
- A mismatched key pair (the private key in use doesn't match the public key published)
- A key copied from a different account or region
- Malformed signature data
- An unsupported algorithm
- The provider rotated its private key without you publishing the new public key
- Someone rolled DNS back to an older value
Never upload or email a private key "for comparison". Ask the sending platform to confirm the key fingerprint, or regenerate an account-specific key pair through its own secure settings.
Record which service owns each selector, so the next person knows who might rotate it.
Problem Four: "Body Hash Did Not Verify" (Something Changed the Email)
This is the sneakiest one, because the signature and the key are both fine. Something changed the email after it was signed.
DKIM works by calculating a fingerprint (hash) of the email body and signing it along with selected headers. If the receiver calculates a different fingerprint, the body it received isn't the one that was signed.
RFC 6376 explains the bh= (body hash), h= (signed headers) and c= (canonicalisation) tags.
Usual suspects, anything that touches the email after signing:
- Outbound gateways
- Automatic disclaimers or legal footers
- Mailing lists that add footers or change the subject
- Link rewriting or "safe links" services
- Security products
- Systems that convert the message format
A quick word on canonicalisation. "Relaxed" mode forgives small formatting differences like extra whitespace. It doesn't forgive actual text or link changes. So a footer added by your gateway after signing will usually break the signature.
The fix isn't to stop signing important headers. It's to either:
- Move signing so it happens after the modification, or
- Configure the intermediary to stop changing signed content
Use a synthetic test email with no customer data. If the only failing example is sensitive, involve your mail security owner rather than forwarding it to several suppliers.
If the email passes through forwarders or mailing lists, the forwarding and mailing list authentication guide explains what to compare.
Quick Diagnosis Table: Which Problem Have You Got?
Here's the cheat sheet:
- dkim=none: nothing signed it. Turn on signing in the sending service.
- No DNS answer at the selector name: key missing or at the wrong name. Publish it correctly.
- permerror: key record is malformed. Fix the record syntax.
- fail with body hash mismatch: something changed the email after signing. Find the intermediary.
- fail with matching body hash: key mismatch. Check the account, rotation and published key.
- temperror: temporary lookup trouble. Check DNS health before changing anything.
Make One Fix and Keep Notes on the Selector
Match the fix to the evidence:
- Publish the missing account-specific key
- Correct the record name
- Repair a CNAME target
- Switch on signing
- Match the provider account to the selector
- Complete a controlled key rotation
- Stop modification after signing
Before touching DNS, save the existing public value, provider settings, TTL, owner and rollback plan. Check nothing already lives at the requested selector. If there's a collision, ask the provider for a new selector name.
For rotation, keep old and new selectors separate and let the sender switch to the new one. Remove the old key only after queued messages and all routes have moved over.
Stop and escalate if the requested value conflicts with existing DNS, the service can't say which private key it uses, a shared gateway changes mail unpredictably, or the change affects several important systems. Don't start trying random selector names.
Prove the Fix With a Fresh Email
Once DNS is public and signing is active, send one plain, non-sensitive email through the same application, account, From domain, gateway and receiving provider.
Check the new original:
- A DKIM signature is present
- d= and s= are the domain and selector you intended
- That exact selector resolves in DNS
- Your receiver reports dkim=pass for that signer
- If DMARC matters, the passing signer aligns with your visible From domain
That's real verification. A green DNS checker alone doesn't prove the private key is being used. A provider badge doesn't prove the email arrived intact.
Also test a route using a different active selector, so you know you didn't break it.
Still failing? Keep both originals and the new reason. If results change unpredictably, timestamps suggest the signing server's clock is wrong, algorithms aren't supported or provider evidence contradicts the receiver, escalate. Send the provider redacted signatures, results, DNS answers, UTC times and the route. Ask which private key version signed the event, without asking them to reveal the key itself.
DKIM is fixed when the receiver validates the signature the real sender produced. Not before.
For aligning a working signature with your From domain, see why DKIM can pass while DMARC fails.
Rotating DKIM Keys Without Breaking Anything
Key rotation is when you replace an old signing key with a new one. It's good security practice, and it's also one of the most common ways people break DKIM by accident.
The safe pattern uses two selectors side by side:
- Generate a new key pair in the sending service, under a new selector (say, mail2027)
- Publish the new public key at mail2027._domainkey.yourbusiness.co.uk
- Confirm it resolves publicly
- Switch the sending service to sign with the new selector
- Send test emails and confirm they carry s=mail2027 and pass
- Leave the old selector (mail2026) published for a while, so delayed and queued emails signed with the old key still verify
- Only then retire the old key
The mistake to avoid is reusing the same selector name and swapping the key in place. The moment you change the DNS record, every email still in transit signed with the old key starts failing. Separate selectors avoid that completely.
And write down which service owns each selector. Two years from now, someone will find "mail2026" in your DNS and wonder whether it's safe to delete. A one-line note saves them a nervous afternoon.
Frequently Asked Questions
How do I find my DKIM selector if I don't have an email header?
Check the sending service's domain authentication settings, which usually show the selector names it uses. But the most reliable source is always a real email header, because it shows what was actually used.
Can I have more than one DKIM record on my domain?
Yes. Each sending service should have its own selector, so you can have several DKIM keys at once. You can't have two different records at the same selector name.
Why does DKIM pass at Gmail but fail at a company's mail server?
Often because something on the receiving side (like a security gateway) changed the message before checking the signature, or because the company checks forwarded copies. Compare the headers from both places to see what differed.
Why does DKIM fail only on some emails from the same platform?
Often because different templates or features take different paths. A message with tracking links, an attachment or an added footer may be modified after signing, while plain messages pass. Compare a failing and a passing header side by side.
What does "dkim=neutral" or "no key for signature" mean?
Usually that the receiver couldn't find or use a public key at the selector named in the signature. Look up that exact selector name in DNS.
Is a 1024-bit key still OK?
Many senders now use 2048-bit keys. Follow your sending service's current recommendation, and check your DNS provider can handle long TXT values (they're often split into chunks automatically).
Can my DNS provider break DKIM?
Yes, occasionally. Some DNS panels mangle long TXT values, add quotation marks in the wrong place or append your domain to the record name. Always query the public answer after publishing and compare it with what the sending service gave you.
Sources and further reading
- RFC 6376: DomainKeys Identified Mail
- RFC 8601: Message Header Field for Indicating Message Authentication Status
- Google Admin Toolbox: Dig