SecDNS

DKIM

DKIM signs outbound email with a cryptographic key published in DNS so receivers can verify the message was sent by an authorised sender and not modified.

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.

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.

Frequently asked questions

How often should I rotate DKIM keys?

At least annually. Use distinct selectors (e.g. s1, s2) so you can publish the new key in parallel, switch signing to it, then retire the old selector after a few weeks.

Does DKIM survive forwarding?

Usually yes. Because DKIM signs the message body and selected headers, most relays and mailing lists preserve the signature. SPF, by contrast, typically breaks under forwarding.