DKIM signatures explained: how email signing works
By the LeadsPaw team · Last updated
DKIM - DomainKeys Identified Mail - is how a domain takes cryptographic responsibility for an email. Per RFC 6376, it permits a person, role or organization to claim some responsibility for a message by associating a domain name with it, validated through a cryptographic signature and by querying the signer's domain directly for the public key. Here is what the signature contains, what a pass actually proves, and where selectors fit in.
How signing and verification work
The signer computes a hash over some or all of the message - selected header fields and the body - and attaches the result as a DKIM-Signature header field, prepended to the message like other trace headers. The signature tags carry the signing domain (d=) and a selector (s=). No certificate authority is involved: the RFC's design has the verifier request the public key directly from a repository in the signer's domain - the DNS - rather than from a third party.
Verification, per the RFC's own scoping, asserts exactly one thing: that the hashed content has not changed since it was signed. It asserts nothing else about "protecting" the end-to-end integrity of the message. A DKIM pass is a statement about the signature and the domain that made it - not a verdict that the email is legitimate, wanted or safe.
The d= domain and why it need not match the From address
DKIM deliberately separates the signer's identity from the message's purported author: the signing identity travels inside the signature, and the RFC states it is not required to match an address in any particular header field. An ESP can sign with its own domain while your address sits in the From: line, and the signature is still valid. Tying the signing domain to the visible From: domain is a separate check - DMARC's alignment - covered in the DMARC policies guide.
Selectors: many keys under one domain
A domain is not limited to one DKIM key. The key namespace is subdivided using selectors, and the RFC's examples include naming office locations or signing dates. That supports real operational needs the RFC lists: delegating signing capability to a partner such as an advertising provider for a given duration, or rotating keys over time - each key lives under its own selector, and the verifier uses the s= tag to fetch the matching public key from the signer's DNS.
Where DKIM sits next to SPF and DMARC
The three mechanisms check different things. SPF authorizes sending hosts through a DNS list; DKIM signs the message content itself; DMARC tells receivers what to do when a message fails and reports back what they saw. Google's sender guidelines ask bulk senders to run all three - the tiers are mapped in Gmail's bulk sender requirements, and the setup guide walks through the DNS records step by step.