How to Set Up DKIM | Email Deliverability Guide
How DKIM Works
Unlike SPF which checks the sending server, DKIM signs the email content itself. Here's how it works:
Your mail server creates a signature
Using a private key, the server creates a unique hash of the email headers and body.The signature is added to the email
ADKIM-Signatureheader is added containing the signature and selector name.Receiving server looks up your public key
Using the selector in the signature, it queriesselector._domainkey.yourdomain.com.Signature is verified
The public key decrypts the signature to verify the email hasn't been modified.
Key point: You publish the public key in DNS, but the private key stays with your email provider. You never need to handle the private key directly.
No DKIM Records Found
If we couldn't find any DKIM records, your emails aren't being signed. This doesn't prevent delivery, but it weakens your email authentication and can hurt deliverability, especially when combined with DMARC.
Note: We check common selectors (google, default, selector1, selector2, etc.), but some providers use custom or randomly generated selectors that we can't auto-detect. If your provider (like AWS SES) shows DKIM as "verified," your emails are likely being signed correctly even if our scanner doesn't find them.
How to set up DKIM
DKIM setup is a two-step process:
- Generate keys — Your email provider generates a public/private key pair
- Publish the public key — You add a TXT record to your DNS
The exact steps depend on your email provider. See the provider-specific guides below.
DKIM record structure
A DKIM record is published at:
selector._domainkey.yourdomain.com
And looks like:
v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC...
DKIM tags explained
v=DKIM1— Version (required)k=rsa— Key type (usually RSA)p=...— The public key (base64 encoded)t=s— (Optional) Strict mode, domain must match exactly
Revoked DKIM Keys
A revoked DKIM key has an empty public key (p=). This tells receiving servers that the key is no longer valid, causing DKIM verification to fail for any email signed with that selector.
This is worse than no DKIM: A revoked key actively causes DKIM failures, while a missing record is simply "not found." If DMARC is enforced, emails with failed DKIM may be rejected.
Why keys get revoked
- Key rotation — Old keys are revoked when new ones are deployed
- Security incident — Key was compromised and intentionally invalidated
- Service migration — Old email provider's keys left behind
How to fix
- Identify the source — Check which email service originally used this selector
- If still using the service — Generate a new DKIM key and update DNS
- If no longer using it — Delete the revoked record from DNS
Safe to delete: If you've migrated away from an email service, you can safely delete their old DKIM records. They're no longer needed.
Setup by Email Provider
Each email provider has their own DKIM setup process. Here are guides for the most common providers:
Google Workspace
- Go to Admin console → Apps → Google Workspace → Gmail → Authenticate email
- Click "Generate new record"
- Choose key length (2048-bit recommended)
- Copy the generated TXT record value
- In your DNS, create a TXT record at
google._domainkey - Return to Admin console and click "Start authentication"
Microsoft 365
- Go to Microsoft 365 Defender → Email & collaboration → Policies → DKIM
- Select your domain
- Microsoft will show you two CNAME records to add
- Add the CNAME records to your DNS
- Return to Microsoft 365 and enable DKIM signing
Note: Microsoft 365 uses CNAME records that point to Microsoft's servers, rather than direct TXT records. This allows Microsoft to rotate keys automatically.
SendGrid
- Go to Settings → Sender Authentication
- Click "Authenticate Your Domain"
- Choose your DNS provider
- SendGrid will generate three CNAME records
- Add all three to your DNS
- Return to SendGrid and verify
Mailchimp / Mandrill
- Go to Settings → Domains → Verify
- Click "View DKIM settings"
- Copy the provided TXT record
- Add it to your DNS at the specified hostname
- Return to Mailchimp and verify
Amazon SES
- Go to SES Console → Verified identities → your domain
- Go to the "Authentication" tab
- Click "Publish DNS records" under DKIM
- If using Route 53, records can be auto-published
- Otherwise, add the three CNAME records manually
Why our scanner may not detect AWS SES DKIM: SES uses randomly generated selector names (like abc123) instead of common ones. If SES shows DKIM as "verified" in your console, your emails are being signed correctly. You can also verify by sending a test email and checking the headers for dkim=pass.
Verify your changes
After making changes, use our checker to confirm everything is configured correctly.