What is DKIM (DomainKeys Identified Mail)?
DKIM (DomainKeys Identified Mail): An email authentication method that adds a cryptographic signature to messages, verified with a public key the signing domain publishes in DNS.
Last reviewed:
DKIM (DomainKeys Identified Mail) is an email authentication method in which a sending domain adds a cryptographic signature to a message header, and receivers verify it with a public key published in DNS. A valid signature shows that the signing domain took responsibility for the message and that the signed content was not altered in transit.
How it works
DKIM is defined in RFC 6376 (September 2011, Internet Standard STD 76). The signer hashes the canonicalized body and selected header fields, signs the result with a private key, and adds a DKIM-Signature header. Its main tags are d= (signing domain), s= (selector), h= (signed header fields), bh= (body hash), and b= (signature data). RFC 6376 requires that the From header field always be signed.
The verifier fetches the public key from a TXT record at <selector>._domainkey.<domain>. Selectors allow several keys per domain at once, which supports routine key rotation and delegating signing to a third party such as an email service provider.
s2026._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...IDAQAB"
A matching signature header looks like this (values shortened):
DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=s2026;
h=from:to:subject:date:list-unsubscribe:list-unsubscribe-post;
bh=...; b=...
RFC 8301 (January 2018) requires RSA keys of at least 1024 bits, recommends at least 2048 bits, and prohibits rsa-sha1. Google's Email sender guidelines state that sending to personal Gmail accounts requires a DKIM key of 1024 bits or longer and recommend a 2048-bit key where the DNS provider supports it.
Why it matters for marketers
Since February 1, 2024, Gmail and Yahoo have required bulk senders to use DKIM in addition to SPF. Microsoft began enforcing SPF and DKIM passes for domains sending more than 5,000 messages a day to Outlook.com, Hotmail.com, and Live.com addresses on May 5, 2025. For DMARC, the d= domain must align with the visible From domain. A signature from a provider's shared domain authenticates the provider, not the brand, so senders typically configure their provider to sign with their own domain.
Common mistakes
- Keeping the provider's default signing domain, so DKIM passes but does not align for DMARC.
- Publishing keys shorter than 1024 bits or signing with
rsa-sha1, both ruled out by RFC 8301. - Truncating or mis-quoting a long public key when pasting it into a DNS panel.
- Never rotating keys, even though selectors exist to make rotation seamless.
- Modifying messages after signing, for example by appending trailers or rewriting content; RFC 6376 notes that such changes can invalidate signatures.
- Leaving
List-UnsubscribeandList-Unsubscribe-Postout ofh=, which RFC 8058 requires for one-click unsubscribe.
Related terms
- SPF (Sender Policy Framework)
- DMARC (Domain-based Message Authentication, Reporting, and Conformance)
- One-click unsubscribe (RFC 8058)
- Bulk sender requirements