Key takeaways
- DKIM signs mail with a private key; receivers check it with a public key in DNS.
- Each sending service needs its own DKIM key and selector.
- Use 2048-bit keys and rotate them at least once a year.
DKIM (DomainKeys Identified Mail) is an email authentication method that adds a digital signature to every message you send. Receiving servers check that signature against a public key published in your DNS, which proves the message was sent by an authorized server and was not changed in transit.
How DKIM works
DKIM uses a key pair. The private key stays on the sending server. The public key is published in DNS for anyone to read.
- The sending server creates a hash of selected headers and the body, then signs it with the private key.
- It adds a "DKIM-Signature" header showing the signing domain (
d=) and the selector (s=). - The receiver looks up
selector._domainkey.domainin DNS, gets the public key, and verifies the signature. - If the message was altered or signed with the wrong key, the check fails.
What is a DKIM selector?
A selector is a name that lets one domain publish many DKIM keys. Each sending service uses its own selector, so your mailbox provider, newsletter tool and CRM can all sign as your domain.
| Service | Typical selector |
|---|---|
| Google Workspace | google |
| Microsoft 365 | selector1, selector2 |
| Mailchimp | k1 |
| SendGrid | s1, s2 |
The selector for any email you received is visible in its DKIM-Signature header. You can test one with the free DKIM checker.
What a DKIM record looks like
google._domainkey.example.com TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqh…"
v=DKIM1 is the version, k=rsa is the key type, and p= is the public key. An empty p= means the key has been revoked.
How to set up DKIM
- List every service that sends email as your domain, including invoices, support tickets and marketing.
- In each service, open the domain authentication settings and generate a DKIM key. Choose 2048-bit if offered.
- Add the DNS record the service gives you — usually a TXT or CNAME at
selector._domainkey. - Click verify or start authentication in the service. Many services only begin signing after this step.
- Send a test email and check that the headers show
dkim=passfor your domain.
d= domain in the signature must match your From domain. If a service signs with its own domain, DKIM passes but does not help DMARC.Key length and rotation
1024-bit RSA keys are still accepted but are considered weak. Use 2048-bit keys where your DNS provider supports long TXT records.
Rotate keys at least once a year, and right away if a sending service is compromised. Publish the new selector first, switch signing, then remove the old key after a few days.
DKIM vs SPF vs DMARC
SPF checks which servers may send for you. DKIM proves a message was not changed and came from an authorized signer. DMARC ties both to the visible From address and tells receivers what to do on failure.
You need all three. See our guide on what DMARC is for the last step.
Frequently asked questions
Does DKIM encrypt my email?
No. DKIM signs the message so it can be verified, but the content is not encrypted. Encryption in transit is handled separately by TLS.
Why does DKIM fail after forwarding?
Some forwarders or mailing lists change the subject or body, for example by adding a footer. Any change to signed content breaks the signature.
Can I have more than one DKIM record?
Yes. Each selector is a separate record, so you can have one per sending service.
How do I find my DKIM selector?
Open the headers of an email sent by that service and look for s= in the DKIM-Signature header, or check the service's domain authentication settings.
The people who build Cysoro's scanners and free security tools. We write practical guides on email authentication, website security and everyday safety, checked against current standards and vendor documentation.
How we write and fact-check →