DKIM key too long for a TXT record: how to publish a 2048-bit key
Updated 10 November 2026 · 4 min read
Short answer
A 2048-bit RSA DKIM public key is roughly 400 characters of base64, longer than one 255-character DNS string. Publish it as one TXT record made of two quoted strings ("v=DKIM1; k=rsa; p=MIIBIjAN…" "…IDAQAB"); receivers join them with no space. Most DNS panels (Cloudflare, GoDaddy, Namecheap) split long values automatically; Route 53 makes you add the quotes. Use 1024 bits only if your DNS host truly can't store the longer value.
The numbers
| Key | Approx. TXT value length | Fits one 255-char string? |
|---|---|---|
| RSA 1024-bit | ≈ 230 characters | Yes |
| RSA 2048-bit | ≈ 410 characters | No, needs two strings |
| Ed25519 (RFC 8463) | ≈ 60 characters | Yes, but not every receiver verifies it, so it is only used alongside RSA |
How each DNS host handles it
| DNS host | What to do |
|---|---|
| Cloudflare | Paste the whole value; Cloudflare splits it |
| GoDaddy, Namecheap, Porkbun | Paste the whole value into one field |
| Route 53 | Type it as "first 255" "rest" on one line |
| BIND zone file | Wrap in parentheses with several quoted strings |
| Older cPanel / some registrars | May truncate silently: check with dig and compare lengths |
; BIND zone file
google._domainkey IN TXT ( "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx..."
"...rest-of-key...IDAQAB" )Verify nothing was lost
- 1
Fetch the published key
dig +short TXT google._domainkey.acme.com - 2
Join the strings
Remove the quotes and the space between them; compare with the value your provider showed.
- 3
Watch for a truncated key
A key cut off at 255 characters gives
dkim=failorpermerror(bad key) even though a record exists.
When 1024 is acceptable
Google, Zoho and Amazon SES all still offer 1024-bit keys for DNS hosts that can't store 2048, and Google recommends 2048 where possible. If you must use 1024, plan to move to 2048 when you change DNS hosts. Changing key length means a new key, so publish it before switching signing on, as described in each provider's guide.
Check the result
The DKIM line shows whether a valid key was found at the selector. Run the domain through the free ReplyDak deliverability check: it reads MX, SPF, DKIM and DMARC live from public DNS, counts SPF lookups and checks the main blocklists, with no sign-up. If your DKIM selector is not a common one, type it into the optional selector box.
More setups and errors: SPF, DKIM and DMARC by provider, DNS host and error.
FAQ
How long is a 2048-bit DKIM key?
About 400 characters in the TXT value, so it must be split into at least two 255-character strings.
Do I put a space between the two DKIM strings?
Not inside the key. The strings are joined with nothing in between; the space between the quoted strings is just DNS syntax.
Is 1024-bit DKIM still accepted?
Yes, receivers accept it, but 2048 is recommended by Google and the default at Amazon SES.