What is DKIM? Email signatures explained

DKIM (DomainKeys Identified Mail) adds a cryptographic signature to every message you send. The receiving server uses it to confirm two things: that a domain took responsibility for the message, and that the signed parts were not changed on the way.
Where SPF checks which server sent a message, DKIM travels with the message itself. That is why it survives most forwarding, which SPF does not.
How signing works
- Your mail server holds a private key and never shares it.
- It computes a signature from the message body and selected headers, then adds a
DKIM-Signatureheader. - The matching public key sits in your DNS.
- The receiver reads the signature, fetches the public key, and checks that they match.
If someone changes the subject or the body in transit, the check fails.
What the records look like
The signature in the message includes two fields you will see in every guide:
DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=mail2026; bh=...; b=...d= is the signing domain and s= is the selector. Together they tell the receiver where to find the key:
mail2026._domainkey.example.com TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkq..."The selector exists so a domain can hold several keys at once: one per sending service, or an old and a new key during a rotation. You can read these fields yourself in any message.
Why DKIM fails
- The record is cut. A 2048-bit key is longer than the 255 characters one DNS string can hold. It must be split into several quoted strings, and some DNS panels damage it while doing so.
- The selector does not match. The record exists under another name, or under the wrong domain.
- The message was rewritten. Mailing lists that add a footer or a subject tag break the body or header signature. Security gateways can do the same.
- The DNS has not updated yet. See DNS propagation.
- The key is too short. Keys under 1024 bits are refused by major providers. Use 2048.
Frequently asked questions
Is DKIM the same as encryption?
No. The message stays readable. DKIM proves origin and integrity. TLS is what protects it in transit.
Do I need one DKIM record per service?
Yes. Each service that sends for your domain (your mailbox, your newsletter, your billing tool) should sign with its own key under its own selector.
How often should I rotate keys?
Many teams rotate once or twice a year. Publish the new key, switch signing to it, and remove the old record once mail signed with it is no longer in transit.
How can I test it?
Use the DKIM check, which finds common selectors, or send a message to yourself and read the Authentication-Results header. You are looking for dkim=pass.
Do I need DMARC as well?
Yes, since DKIM alone does not tell a receiver what to do with a failure, and the signing domain can differ from your visible address. DMARC ties them together.
Smailor signs outgoing mail with a key per domain and shows you the record to publish when you add your domain. See also our DKIM keys guide.