Opens in a new tab

DKIM key length: 1024 vs 2048 bits

Signers must use RSA keys of at least 1024 bits and should use 2048. Receivers reject shorter keys. A 2048-bit key is too long for one 255-character TXT string, which is where most publishing mistakes happen.

Syntaxv=DKIM1; k=rsa; p=<public key>
Minimum1024 bits (RFC 8301)
Recommended2048 bits
Receivers must verify1024 to 4096 bits
Also possibleEd25519 (RFC 8463), usually alongside an RSA key
Defined inRFC 8301

What it does

RFC 8301 set the floor in 2018: signers must not use keys under 1024 bits, and should use 2048. Keys of 512 or 768 bits fail at major receivers.

A TXT record’s value is made of strings of at most 255 characters each; a 2048-bit key is about 400. The key goes in one TXT record as several quoted strings, which receivers join without spaces. Most DNS panels do this for you; some need you to paste the parts in quotes.

Examples

google._domainkey IN TXT ( "v=DKIM1; k=rsa; p=MIIBIjANBgkqh…first part…" "…second part…IDAQAB" )

One record, two strings: joined, they are the key.

See what your own DKIM record says

Every term of your published record, read and explained — including this one.

Common mistakes

  • Splitting the key into two separate TXT records instead of two strings in one record.
  • A space or line break pasted into the middle of the key.

What we recommend

Use 2048-bit keys. If your DNS host cannot hold one, use 1024 until you can move, not less.

Check your DKIM key lengths →

Sources

Checked on 25 September 2026 against these official sources:

Know when your records change

Add your domain and we monitor its SPF, DKIM and DMARC every day, read the DMARC reports receivers send you, and email you when a record changes or a sender starts failing. Free for your first domain.

Create a free account