Key takeaways
- Read the DKIM-Signature header of a failing message first.
- Its d= and s= tags tell you which domain and selector the receiver looked up.
- If the record is missing or different, fix DNS.
A DKIM failure from Mailgun almost always has one of five causes: the record is at the wrong name, the key was damaged when it was pasted or split, the DNS host altered the name, the signature uses a selector that no longer exists, or the message is not being signed with the domain you expect. The table below pairs each symptom with a check you can run and the fix that follows from it.
Research checked: 12 November 2026
The short answer
Read the `DKIM-Signature` header of a failing message first. Its `d=` and `s=` tags tell you which domain and selector the receiver looked up. Then run `dig` against that exact name. If the record is missing or different, fix DNS. If it is correct, the problem is in the signing side or in a message altered after signing.
Symptom table
| Symptom | Likely cause | Check | Fix |
|---|---|---|---|
| `dkim=none` | No `DKIM-Signature` on the message | Look for the header in the raw message | Confirm the sending path is signing with the domain |
| `dkim=fail` with a key error | Record missing at `<selector>._domainkey` | `dig +short TXT <selector>._domainkey.<domain>` returns nothing | Publish the record at the name Mailgun shows |
| `dkim=fail` with a key error | Key text damaged | Compare the `p=` value with the control panel character by character | Re-copy the full value; rejoin any split strings |
| "Expected TXT record" or "no such host" from a DNS validator | DKIM key split into separate quoted strings that were not rejoined | Dig shows several fragments | Join them into one continuous quoted value |
| Name shows doubled domain | DNS host appended the domain | Look for `.example.com.example.com` in the zone | Enter only the left-hand part of the name |
| Record exists but fails after rotation | Old selector removed before mail finished | Compare the `s=` in failing mail to what is published | Republish the old selector until the new one is proven |
| Multiple keys, some unverified | Expected after rotation | Confirm the key your domain signs with is published | No action if the active key is correct |
| `dkim=pass` but DMARC fails | Signing domain does not align with From | Compare `d=` with the From domain | Sign with a domain that aligns, or send from the signing domain |
Symptoms in detail
Symptom 1: No signature at all
If there is no `DKIM-Signature` header, the message left without being signed. Check for a relay or forwarder that rewrote it. Signing happens on the sending side, so a forwarder that re-sends the message without its signature removes DKIM entirely.
Symptom 2: Record missing or unreadable
Mailgun's verification guide says changes can take 24 to 48 hours to propagate. Before waiting, check the name. A record at `_domainkey.example.com` without the selector is a common error. Run the `dig` command against the full selector name and expect a single TXT answer.
Symptom 3: Damaged key
The two common damage points are the copy and the split. A 2048-bit key may need two quoted strings in some DNS hosts. If the strings are not rejoined, or a character is lost, the receiver sees a key it cannot read. The `p=` value must be the complete public key, so re-copy the entire value from Mailgun.
Symptom 4: Name doubled by the DNS host
Some hosts add your domain to any name you enter. The result is a record at a doubled name that never matches the selector. Look at the zone file, not the form. If you see the doubled name, delete it and enter the short name.
Symptom 5: Selector removed too early
A message in transit still carries the old selector. If you have deleted the old record, verification fails for that message while new messages pass. Keep the old key published until a test shows the new selector signing and verifying. Mailgun's DKIM security page advises keeping both keys active during a transition, because providers may cache DNS.
Symptom 6: Pass but DMARC fails
DKIM can pass while DMARC still fails. RFC 7489 requires an aligned identifier, so a valid signature on `mailgun.example.net` does not help a message whose From is `example.com`. Check the `d=` tag. If it does not match your From domain under relaxed alignment, configure signing on the correct domain.
Symptom 7: Signature breaks after the message leaves
A signature covers specific headers and the body. A footer added by a list tool or a rewritten link can invalidate it. Send a test through the same path as production mail and compare headers before and after that step.