Cybersecurity
What is DKIM?
Also called DomainKeys Identified Mail, DKIM signature.
Short definition
DKIM (DomainKeys Identified Mail) is a digital signature added to every outgoing email, so the receiving server can confirm the email really came from the sender's domain and was not altered in transit.
How it works
The sending mail server holds a private key and uses it to sign the headers and body of every email. The matching public key is published in the domain's DNS as a TXT record under a selector name, for example selector1._domainkey.example.co.id. The receiving server retrieves that public key and checks the signature. If the email content is changed after it is sent, the signature no longer matches.
How it differs from SPF
SPF checks which server an email was sent from, while DKIM checks whether the email was signed by a legitimate domain. Because the signature travels with the email, DKIM usually still passes when an email is forwarded, a situation that often makes SPF fail. Together they form the basis for DMARC to decide what to do with suspicious email.
Things to keep in mind
Every service that sends email on behalf of your domain, such as office email, newsletter tools, and billing systems, needs DKIM enabled with its own key. Use keys long enough to meet the provider's recommendation, and rotate them regularly or immediately if a leak is suspected. Publish the new key before revoking the old one, so no email fails verification. DKIM results are visible in the headers of received email, so a new setup is easy to test by sending an email to your own inbox.
Related terms
Resources
- RFC 6376: DomainKeys Identified Mail (DKIM) Signatures (rfc-editor.org)
- Cloudflare Learning: What is a DNS DKIM record? (cloudflare.com)