Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
DKIM attaches a cryptographic signature to outgoing email so a receiver can confirm the message came from the claimed domain and was not altered in transit.

What Is DKIM?
DomainKeys Identified Mail, specified in RFC 6376, adds a digital signature to an email so that any receiver can verify two things: that the message was authorised by the domain that signed it, and that the signed parts have not been modified since. The private key sits on the sending infrastructure; the public key is published in DNS. Unlike SPF, which authorises sending addresses, DKIM travels with the message, so it survives a hop that SPF would not.
The sending server adds a DKIM-Signature header containing, among other tags, the signing domain d=, the selector s=, the list of signed headers h=, a hash of the body bh=, and the signature itself b=. A receiver reads the domain and selector, fetches the public key from <selector>._domainkey.<domain>, and checks both hashes.
The h= tag deserves attention. Only the headers it names are protected. Sign From, Subject, Date, To, and Message-ID at minimum. If From is unsigned the signature is close to meaningless, and if Subject is unsigned an on-path attacker can rewrite it without breaking anything. A known trick, DKIM header injection, adds a second copy of a signed header, which some verifiers handle differently from some mail clients; listing a header twice in h= prevents the addition of an extra instance.
Body canonicalisation also matters. The relaxed mode tolerates whitespace changes in transit and is what nearly everyone uses; simple breaks easily.
A selector record is an ordinary TXT record:
sel2026._domainkey.example.co.uk. IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkq...IDAQAB"
Selectors exist so that one domain can run several signing systems and rotate keys without downtime. Give each platform its own selector — your mail platform, your marketing tool, your ticketing system — and name them so a human can tell what they belong to.
Key length is a live issue. RFC 8301 prohibits keys shorter than 1,024 bits and recommends 2,048, which is now the default on most platforms. Several providers still issue 1,024-bit keys, and a few older systems cannot store a 2,048-bit key in a single TXT string, which is a configuration problem rather than a reason to accept weak keys. Ed25519 signing is defined in RFC 8463 and produces short records, though verifier support remains partial, so it is published alongside an RSA selector rather than instead of one.
Keys get forgotten. A selector published for a marketing platform you stopped using three years ago is a live signing authority for your domain in the hands of a third party. Inventory every selector in your DNS, confirm which system owns each, and remove the orphans.
Rotate on a schedule, typically every six to twelve months, using a pre-publish approach: publish the new selector, switch the signing system to it, wait beyond the longest plausible delivery delay, then remove the old record. Revoke a selector by replacing the p= value with an empty string rather than deleting the record, which tells verifiers the key was withdrawn deliberately.
On its own, a valid DKIM signature says only that someone with the key signed the message. It does not require the signing domain to match the visible From address, so an attacker can sign their own message with their own domain perfectly validly. DMARC supplies the missing requirement by demanding alignment between the d= domain and the From domain, and by telling receivers what to do when neither SPF nor DKIM aligns.
That is the practical sequence for any organisation: sign everything with DKIM, publish SPF for every sending source, then publish DMARC and read the aggregate reports until every legitimate stream is aligned. Only then move to enforcement. Forwarding breaks SPF but usually preserves DKIM, which is precisely why DMARC accepts either, and why ARC exists for the cases where a list server modifies the body and breaks the signature too.
Our Email Security Solutions cover selector inventory, key rotation, and the route to DMARC enforcement.
No. DKIM signs, it does not encrypt. Anyone who intercepts the message can still read it; the signature only proves the signed parts were not altered and that the signing domain authorised the message. Transport encryption between servers is a separate concern handled by STARTTLS with MTA-STS or DANE, and end-to-end confidentiality needs S/MIME or PGP.
Use 2,048-bit RSA. RFC 8301 forbids anything below 1,024 bits and recommends 2,048, and 1,024-bit keys are considered weak for long-lived signing. If a platform insists it cannot store a 2,048-bit key, that is a limitation to raise with the vendor. Ed25519 keys are shorter and supported by RFC 8463, but verifier coverage is still incomplete.
Simple forwarding usually preserves the signature, because the signed headers and body are unchanged. Mailing lists break it when they rewrite the subject line or append a footer, since both alter signed content. This is exactly the case ARC was designed for, allowing the forwarder to record and seal the authentication result it saw before modifying the message.
Every six to twelve months is a reasonable cadence, and immediately if a signing system is compromised or a supplier relationship ends. Use a pre-publish rollover: publish the new selector, switch signing to it, wait past the longest expected delivery delay, then revoke the old one by emptying its p tag rather than deleting the record.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.