DKIM(DomainKeys Identified Mail)
An email authentication method that uses cryptographic signatures to verify email integrity.
Definition
DKIM (DomainKeys Identified Mail) is an email authentication standard that uses public-key cryptography to verify that an email was sent by an authorized sender and was not modified in transit. The sending server signs the email with a private key, and the receiving server uses the public key (published in DNS) to verify the signature. Think of it as a tamper-proof seal on your emails.
Why It Matters
DKIM provides a way to prove email authenticity and integrity. Emails with valid DKIM signatures are more trusted by receiving servers and less likely to land in spam. DKIM also enables DMARC alignment, which is increasingly required for good deliverability. Without DKIM, anyone could forge emails claiming to be from your domain.
How It Works
When you send an email, your mail server creates a hash of specified headers and body content, encrypts it with your private key, and adds this signature to the email headers as 'DKIM-Signature'. The receiving server retrieves your public key from DNS using the selector in the signature, decrypts the hash, and compares it to a newly computed hash. A match confirms the email is authentic and was not modified after signing.
Example
When Sequenzy sends a newsletter for example.com, it adds a DKIM-Signature header:
DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=seq1; h=from:to:subject:date; bh=abc123...; b=xyz789...
Breaking it down: - d=example.com shows which domain signed the email - s=seq1 is the selector (identifies which key to use) - b= is the actual cryptographic signature
When Gmail receives this email, it looks up seq1._domainkey.example.com in DNS, finds the public key, and uses it to verify the signature. If someone modified the email in transit, the verification would fail.
Best Practices
- 1Use a 2048-bit key or larger for security (1024-bit is considered weak)
- 2Rotate DKIM keys periodically (every 6-12 months) for security
- 3Set up DKIM for all domains and subdomains you send from
- 4Monitor DKIM signing success in your email platform dashboard
- 5Test your DKIM setup with tools like mail-tester.com before sending
Automatic DKIM Signing
Sequenzy automatically signs all your emails with DKIM. Just add our DNS records to your domain.
Learn MoreDKIM Record Table
| DKIM part | Where it appears | Purpose |
|---|---|---|
| Selector | DKIM signature and DNS hostname | Identifies which public key receivers should use |
| Signing domain | d= value in the signature |
Shows which domain signed the message |
| Public key | DNS TXT record | Lets receivers verify the private-key signature |
| Signed headers | h= value in the signature |
Lists signed header fields; bh= contains the body hash |
DKIM and Alignment Troubleshooting
| Failure | Common cause | Fix |
|---|---|---|
| Record not found | Wrong selector or DNS hostname | Confirm the selector and _domainkey record name |
| Signature mismatch | Email modified after signing | Check forwarding, footers, or gateway rewriting |
| Weak key | Old 1024-bit key | Rotate to a 2048-bit key where supported |
| Wrong domain alignment | DKIM can pass for a provider domain while remaining unaligned for DMARC | Configure custom domain signing |
DKIM Setup Checklist
| Step | What to verify | Tool or evidence |
|---|---|---|
| Generate key | Provider has created selector and public key | ESP domain settings |
| Publish DNS | TXT record exists at selector hostname | DNS lookup or MXToolbox |
| Send test email | Message includes DKIM-Signature header | Raw email headers |
| Confirm alignment | DKIM domain aligns with the visible From domain under the configured DMARC alignment mode | Authentication results header |