DKIM
DKIM (DomainKeys Identified Mail) is an email authentication mechanism that attaches a cryptographic signature to each outbound message and publishes the verifying public key in DNS, so receivers can prove the message originated from an authorised sender and was not modified.
In plain English
A DKIM-signing mail server adds a special header to every message containing a digital signature over the body and selected headers. The receiving server fetches the matching public key from your DNS, verifies the signature, and can then trust the message's claimed domain even if it was forwarded through several relays.
How it works
DKIM is defined in RFC 6376. The sending server stores a private key; the matching public key is published as a TXT record at <selector>._domainkey.example.com. Each outbound message is signed by writing a DKIM-Signature: header that lists the canonicalisation (relaxed/relaxed is standard), the signed headers (the h= tag), the body hash, the signing domain (d=), the selector (s=), and the base64 signature. Receivers look up the public key, recompute the hash, and verify. Because DKIM signs the message itself, signatures survive forwarding through mailing lists and most relays, unlike SPF which breaks under forwarding. Selectors enable key rotation without downtime — publish the new key under a new selector, switch signing, wait, then remove the old one. RSA-2048 and Ed25519 keys are both common.
Related terms
- TXT record — DKIM public keys live in TXT
- SPF — partner authentication mechanism
- DMARC — uses DKIM as one of its inputs
- MX record — receiving side
- DNS — base protocol
- Authoritative DNS — publishes the DKIM key
SecDNS perspective
SecDNS hosts DKIM public keys with proper TXT chunking, supports key rotation by selector, and surfaces a query graph so you can see when a retired selector is finally safe to delete.