DKIM Signature CheckerValidate Cryptographic Email Auth
Check DKIM records to verify selector configuration, validate public keys, and ensure proper cryptographic email signature setup.
DKIM Signature Validation
DKIM (DomainKeys Identified Mail) uses cryptographic signatures to verify email authenticity and integrity. Sending mail servers sign outgoing messages with a private key; receiving servers validate signatures using public keys published in DNS TXT records. Unlike SPF, DKIM survives email forwarding, making it a critical component of email authentication.
How DKIM Works
When your mail server sends an email, it generates a cryptographic signature from selected headers and the message body using a private key. This signature is added to the email as a DKIM-Signature header. The receiving server retrieves the corresponding public key from DNS and uses it to verify the signature.
If the signature validates, it proves two things: the email was authorized by the domain owner (authentication) and the signed headers and body were not modified in transit (integrity). If either check fails, the email may be flagged as suspicious or rejected depending on the receiving server's policies.
DKIM Selectors
DKIM uses selectors to support multiple keys per domain. Selectors are arbitrary names chosen by the domain owner. Common selectors include default, google, k1, and selector1.
Public keys are published at selector._domainkey.example.com. For example, Google Workspace uses google._domainkey.example.com. The selector is specified in the s= tag of the DKIM-Signature header, which tells the receiving server where to find the public key.
DKIM Record Structure
A DKIM TXT record contains tags separated by semicolons. Key tags include v=DKIM1 (version), k=rsa (key type), and p=... (public key in Base64).
Example: v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBi...
Optional tags include t=s (strict sender domain check) and g= (granularity of the key). Most implementations only require the version, key type, and public key.
Key Rotation & Security
Rotate DKIM keys annually or when private keys may be compromised. Use 2048-bit RSA keys minimum (1024-bit is deprecated). Multiple selectors enable zero-downtime rotation — publish the new key, update mail server configuration, then remove the old key after emails signed with it have been delivered.
DKIM signatures include a timestamp and optional expiration. This prevents replay attacks where attackers resend old signed messages. Most implementations set 48-72 hour expiration windows.
Store private keys securely and never expose them in version control or logs. If a private key is compromised, generate a new key pair immediately and publish the new public key. Revoke the old key by removing its DNS record.
DKIM vs SPF vs DMARC
SPF verifies the envelope sender (Return-Path) against authorized IP addresses. It breaks when emails are forwarded.
DKIM verifies the message signature against a public key. It survives forwarding because the signature is part of the message headers.
DMARC combines SPF and DKIM results and defines policies for handling failures. It also provides reporting visibility. All three work together — implement them all for complete email authentication.