Which key size
| Key | Status |
|---|---|
| RSA 512 or 768 bits | Rejected. Receivers treat signatures with these keys as failed; they can be cracked. |
| RSA 1024 bits | The minimum receivers still accept. Fine for now, but plan to move up. |
| RSA 2048 bits | Recommended. Supported everywhere. |
| Ed25519 | Modern and short, but not every receiver verifies it yet. Only use it next to an RSA signature. |
Also check the hash algorithm: signatures must use rsa-sha256. SHA-1 is no longer trusted, and a key record restricted to
h=sha1 makes every signature fail.
A 2048-bit key doesn't fit in one 255-character TXT string. Your DNS panel has to split it into several strings in one record; most do this automatically. Check the result, because a broken split means no valid key.
Rotating keys without breaking mail
Rotating means replacing your signing key periodically, typically every six to twelve months, or immediately if a key may have leaked. Use a new selector for each key so the old and new key can exist side by side:
- Generate a new key pair and publish the public key at a new selector, for example
s202610._domainkey. - Wait until DNS has propagated (at least the TTL of the record, a day to be safe).
- Switch your mail server to sign with the new selector.
- Keep the old public key published for another week or so: messages signed with it may still be in transit or checked later.
- Revoke the old key by publishing it with an empty value (
v=DKIM1; p=), or remove it.
Hosted services (Microsoft 365, Google Workspace, most email platforms) rotate for you once DKIM is set up with their CNAME records. If you publish TXT keys yourself, rotation is your job.
Testing mode
A key record with t=y says the domain is testing DKIM, and receivers may ignore its signatures. Remove the flag once signing works.