DKIM key too long for DNS? Split the TXT record

Short answer

A single DNS TXT string is capped at 255 characters, and a 2048-bit DKIM key is longer. The fix is to split the key into multiple quoted strings within one TXT record — DNS concatenates them. Most providers do this automatically; if yours doesn’t, break the p= value into 255-char chunks in quotes.

Why it happens

DKIM moved to 2048-bit keys for security, but a 2048-bit public key exceeds a single TXT string’s 255-char limit. The record is still valid — it just must be published as several concatenated strings.

How to fix it

Use your provider’s chunked format, or manually wrap the key: "v=DKIM1; k=rsa; p=MIIBIj...first255..." "...rest...". Verifiers join the quoted strings back into the full key.

  1. 1

    Verify the key resolves whole

    Check the selector:

    $ dig TXT selector._domainkey.yourdomain.com +short

Check your DKIM record now

Open the free DKIM checker →

Frequently asked questions

Should I use a 1024 or 2048-bit DKIM key?

2048-bit is the modern recommendation. The length issue is purely a DNS formatting detail, not a reason to downgrade.

DKIM is defined in RFC 6376.

Reviewed by the Skysnag Security Team. Last updated .