DKIM, DomainKeys Identified Mail, is an email authentication method that signs each message with a private key. The receiving server fetches the matching public key from your DNS and checks the signature. If it verifies, the receiver knows that your domain vouches for the message and that the signed parts were not changed on the way. DKIM is defined in RFC 6376.
How DKIM works
- You publish a public key as a DNS record at
selector._domainkey.yourdomain. - The sender signs. Your email provider hashes the body and a chosen list of headers, signs the result with the private key, and adds a
DKIM-Signatureheader. - The receiver verifies. It reads the
d=(domain) ands=(selector) tags, fetches the public key from DNS, and checks the signature. The result is pass or fail.
Because the signature travels inside the message, DKIM usually survives forwarding, unlike SPF. It breaks when something in the middle changes signed content, such as a mailing list adding a footer.
Example DKIM signature header
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=acme.com; s=mc1; h=from:to:subject:date:message-id;
bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=;
b=dzdVyOfAKCdLXdJOc9G2q8LoXSlEniSbav+yuU4zGeeruD00lszZ...
| Tag | Meaning |
|---|---|
d= |
The signing domain |
s= |
The selector, used to find the key |
h= |
The headers that were signed |
bh= |
Hash of the body |
b= |
The signature itself |
And the DNS side. Some providers ask for a TXT record with the key, others for a CNAME that points to a key they host and rotate:
mc1._domainkey.acme.com. CNAME mc1.dkim.provider.example.
Why it matters for app email
Gmail requires SPF or DKIM from every sender and DKIM from bulk senders (Google sender guidelines). DKIM is also the sturdier path to passing DMARC: when the d= domain matches your From domain, DMARC passes even if the message was forwarded and SPF failed. A domain-aligned DKIM signature builds reputation for your own domain rather than your provider’s.
Common mistakes
- Signing with the provider’s domain instead of yours, so DKIM passes but does not align for DMARC.
- Pasting the key with quotes or line breaks in the wrong place. Long TXT values must be split into strings correctly by your DNS host.
- Adding
._domainkey.yourdomaintwice, because the DNS host appends the domain automatically. - Using 512-bit or 768-bit keys. RFC 6376 requires at least 1024 bits for long-lived keys.
- Never rotating keys you manage yourself.
Check a selector with our tools and see the DKIM setup guide.
How Mailcandor handles it
Mailcandor gives you three DKIM CNAME records when you add a domain, and its deliverability coach checks that they resolve.