RFC 6376

DKIM: DomainKeys Identified Mail

DKIM cryptographically signs every outbound message with a private key; receivers verify the signature against your public key in DNS. Survives forwarding, unlike SPF.

TL;DR

What it does

DKIM proves that a message wasn't tampered with in transit and that it was authorised by the holder of your domain's private key. The sending server adds a DKIM-Signature header that includes a hash of selected parts of the message; receivers reproduce the hash and verify it against your published public key.

Crucially, the DKIM signature travels with the message. When a recipient forwards your email, the DKIM signature still validates at the next hop (assuming the forwarder doesn't rewrite the body). That makes DKIM the protocol that DMARC alignment relies on for forwarded mail.

Each ESP signs with their own key, so you publish multiple selectors (one per sender). Modern ESPs auto-rotate keys via CNAME records you publish.

How it works

  1. Generate a 2048-bit RSA key pair (or have your ESP do it).
  2. Publish the public key as a TXT record at <selector>._domainkey.<your-domain>.
  3. Configure your sending server / ESP to sign every outbound message with the matching private key.
  4. Receivers retrieve the public key via the DKIM-Signature header's d= and s= tags, hash the message body + headers per the algorithm, and compare to the included signature.
  5. A pass result feeds DMARC alignment; a fail flags the message.

Example record

google._domainkey.yourdomain.com TXT

v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A... (truncated)

Common pitfalls

Related tools

Want PhishFence to monitor DKIM for your domains?

Sign up free, add a domain, and PhishFence will continuously check DKIM (and the rest of the email-auth stack) for you.

Start free