Glossary · Authentication
What is DKIM?
DKIM (DomainKeys Identified Mail) adds a cryptographic signature to each email, and publishes the matching public key in DNS, so receivers can verify the message came from the domain and wasn't changed.
How DKIM works
- The sending server signs selected headers and the body with a private key and adds a
DKIM-Signatureheader. - The header names the signing domain (
d=) and a selector (s=). - The receiver fetches the public key from
<selector>._domainkey.<domain>in DNS and verifies the signature.
A DKIM DNS record looks like this:
s1._domainkey.mail.acme.com TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."
Many providers publish DKIM as CNAME records that point to keys they rotate for you.
Key length
Use 2048-bit RSA keys where your DNS provider supports long TXT records. 1024-bit keys still validate but are considered weak.
DKIM and DMARC
For DMARC, the DKIM signing domain (d=) must align with the From domain. Signing with your email provider's domain instead of yours passes DKIM but fails DMARC alignment.