Black Friday: 60% off yearly plans with code BF2026, until November 30. See the deal

Learn

What is DKIM?

DKIM (DomainKeys Identified Mail) signs each outgoing message with a private key and publishes the matching public key in DNS, so receivers can verify the message came from an authorized system and was not altered in transit. It is defined in RFC 6376.

The short answer
  • The sender signs headers and body. The receiver checks the signature with a public key from DNS.
  • The key lives at selector._domainkey.yourdomain in a TXT record.
  • DKIM survives forwarding better than SPF, which is why DMARC leans on it.
Try the dmarc checkerFree, live, no signup

How does DKIM verification work?

  1. 01

    Sign

    The sending server hashes chosen headers and the body and signs the hash with its private key. The result goes into a DKIM-Signature header.

  2. 02

    Name the key

    The header carries d= (signing domain) and s= (selector), which together say where to find the public key.

  3. 03

    Look up

    The receiver queries TXT at selector._domainkey.d-domain.

  4. 04

    Verify

    The receiver recomputes the hash and checks it against the signature. A match means the signed parts are unchanged.

  5. 05

    Report

    The result appears as dkim=pass or dkim=fail in Authentication-Results.

What are the tags in a DKIM-Signature header?

Required and common tags, RFC 6376 section 3.5
TagMeaningRequired
vVersion, must be 1Yes
aAlgorithm, such as rsa-sha256Yes
dSigning domainYes
sSelectorYes
hList of signed header fieldsYes
bh / bBody hash and signature dataYes
t / xSignature timestamp and expirationNo

What does the public key record look like?

TXT record at google._domainkey.example.com
google._domainkey.example.com.  IN  TXT  "v=DKIM1; k=rsa; p=MIIBIjANBgkq...IDAQAB"
; v=DKIM1   version
; k=rsa     key type (default)
; p=        base64 public key; empty p= means the key is revoked

What DKIM does not prove

A valid signature shows that a domain in d= signed the message. It does not say the d= domain matches the visible From address. That check is DMARC alignment.

How do DKIM, SPF and DMARC differ?

Three layers of email authentication
ItemSPFDKIMDMARC
What it checksSending IP against a DNS listSignature over headers and bodyAlignment with the From domain
Where publishedTXT at the domainTXT at selector._domainkeyTXT at _dmarc
Survives forwardingUsually noYes, if content is unchangedDepends on SPF or DKIM
Gives you reportsNoNoYes (rua)

What can break a DKIM signature?

  • A mailing list or gateway that adds a footer or rewrites the subject after signing
  • A DNS key record that is missing, truncated or has a typo in the p= value
  • Signing with a selector whose key was removed or revoked with an empty p=
  • Header or body changes by a security gateway between the signer and the receiver

What do key length and algorithm mean for you?

Minimum

RFC 6376 says signers must use RSA keys of at least 1024 bits for long-lived keys.

Gmail

Google requires 1024 bits or longer for mail to personal Gmail accounts and recommends 2048.

DNS fit

A 2048-bit key is a long TXT value. Some DNS panels need it split into strings or reject it.

Common questions

What does DKIM stand for?

DomainKeys Identified Mail. It is an IETF standard (RFC 6376) for attaching a verifiable signature to email so receivers can confirm which domain signed it and that signed content was not changed.

Is DKIM the same as SPF?

No. SPF authorizes sending IP addresses through a DNS list. DKIM signs the message content with a key. They fail differently: SPF breaks on forwarding, DKIM breaks when a signed part is modified.

Where is the DKIM record stored?

In a DNS TXT record at selector._domainkey.yourdomain. Some providers, such as Microsoft 365, ask for two CNAME records at selector1._domainkey and selector2._domainkey that point to keys they host.

Do I need DKIM if I have SPF?

Yes for any serious sending. Google and Yahoo require both SPF and DKIM from bulk senders, and DMARC passes if either aligned method passes, so DKIM gives a second path.

Can a message have more than one DKIM signature?

Yes. A message can carry several DKIM-Signature headers, for example one from your own domain and one from your mail provider. DMARC passes if any aligned signature verifies.

Watch your domains automatically

Aepto monitors expiry, DNS, SSL and uptime for every domain you own and alerts you when something changes. Free for 3 domains.