DKIM key length

RFC 8301 says signers must use RSA keys of at least 1024 bits and should use at least 2048. A 1024-bit key still verifies today, but 2048 is the length to publish now, and rotating to it takes one DNS record and one setting at your mail service.

What the standards say

DKIM key requirements
KeyStatusSource
RSA under 1024 bitsMust not be used; receivers may ignore the signatureRFC 8301 section 3.2
RSA 1024 bitsAllowed, weakRFC 8301 section 3.2
RSA 2048 bits or moreRecommendedRFC 8301 section 3.2
Ed25519Allowed, short and strong; not every receiver verifies it yet, so publish it beside an RSA keyRFC 8463
rsa-sha1 signingMust not be usedRFC 8301 section 3.1

Publishing a 2048-bit key

A 2048-bit public key is about 400 characters of base64, longer than the 255 characters one DNS text string can hold. The record is still one TXT record: it is split into several quoted strings that receivers join back together.

A long key split into strings
s2048._domainkey.example.com. TXT ( "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx" "...rest of the key...IDAQAB" )

Many control panels split it for you. Check the published result with the DKIM checker: it reports the key length it actually reads.

Rotating safely

  1. Publish the new key under a new selector.
  2. Wait until DNS shows it everywhere (the old TTL has passed).
  3. Switch the mail service to sign with the new selector.
  4. Keep the old key published for a week so messages in transit still verify.
  5. Revoke the old key by publishing it with an empty p=, or remove it.