Key points
- The public key lives in a TXT record under selector._domainkey.domain.
- The signature covers chosen headers and the body, so changes in transit break it.
- Unlike SPF, a DKIM signature usually survives simple forwarding.
- RFC 8301 requires keys of at least 1024 bits; 2048 bits is the usual choice today.
How does DKIM work?
The sending server computes a hash of the message body and of a list of headers, such as From, Subject and Date, then signs it with its private key. The result goes into a DKIM-Signature header that names the signing domain in the d= tag and the selector in the s= tag.
The receiving server reads those two tags, queries selector._domainkey.domain in DNS, obtains the public key and verifies the signature. If the body or any signed header changed, verification fails.
What is a DKIM selector?
A selector is a label that lets one domain publish several keys at the same time. Each sending system can have its own key, and the domain can rotate keys by publishing a new selector before retiring the old one, without interrupting delivery.
What breaks a DKIM signature?
Anything that rewrites the signed parts: a mailing list that adds a footer or tags the subject, a gateway that inserts a disclaimer or a server that re-encodes the body.
Key problems break it as well, such as a record truncated when pasted into the DNS panel or a private key on the server that no longer matches the published one.
Example DKIM public key record
s1._domainkey.example.com. TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."How AHSU 360 handles this
AHSU 360 verifies DKIM, SPF and DMARC on inbound mail before delivery to the mail server. For outbound mail sent through the UNODATA relay, it adds a DKIM signature to every message and enforces a sending limit per account.
