DKIM

DKIM · DNS · TXT records

2048-bit DKIM key truncated: fix the 255-character TXT split

First published 27 October 2026 · Updated on 12 November 2026 · Verified against RFC 1035 (255-octet character strings), RFC 6376 (DKIM key records) and Cloudflare’s DNS FAQ (sources listed below)

Merroway Editorial · Verified against governing standards and vendor documentation.

The fast answer

Do not create a second TXT record, and do not paste the key twice. Query the selector yourself (dig TXT selector._domainkey.yourdomain +short) and compare the concatenated p= value with the key your provider generated. If it is shorter, your panel truncated it: re-enter the value as several quoted strings of at most 255 characters inside one TXT record — or switch to a panel (or a CNAME DKIM setup) that splits automatically. Then re-test before touching anything else.

Advertisements

What you are looking at, in plain words

DNS TXT records are not single long strings. By the DNS specification (RFC 1035), a TXT record is one or more character-strings, each at most 255 octets, and a reader concatenates them back together. A 1024-bit DKIM key fits in one string; a 2048-bit key — the length Google Workspace recommends where supported — does not, at roughly 400 characters of base64. Panels handle this three ways: they split automatically and show you the quotes in the middle (correct, and the quotes are expected, not an error); they accept multiple quoted strings from you (correct, if you split right); or they silently truncate at 255 characters or reject the value (broken, and the breakage is invisible in the panel). The symptom is distinctive: DKIM fails immediately after a key upgrade or rotation to 2048-bit, on a domain where DKIM previously worked.

Step 0 — Prove which part is failing

  1. Confirm the trigger: did DKIM break when you moved from 1024-bit to 2048-bit, or rotated to a new 2048-bit key? If DKIM never worked, this is probably not the guide — check the selector and key first.
  2. Query the selector: dig TXT google._domainkey.yourdomain +short (using your own selector, for example google for Workspace or your ESP’s selector). Count the characters in the p= value after concatenation. A 2048-bit key truncated to around 255 characters is the smoking gun.
  3. Compare character for character with the key your provider generated. A truncated key matches at the start and stops; a wrong key differs throughout.
Do not fix the wrong thing first. Do not rotate to yet another key, and do not drop back to 1024-bit in a panic without understanding the trade-off. The truncation is a presentation problem in one DNS panel, not a cryptography problem — and a fresh key pasted into the same panel truncates exactly the same way.

Fix 1 — Split the value into quoted strings inside one TXT record

If your panel accepts long values as multiple strings, enter the key as consecutive quoted chunks of at most 255 characters each, with no spaces between the chunks’ content, for example (shortened):

"v=DKIM1; k=rsa; p=first-255-characters" "remaining-characters"

The quotes are part of the DNS syntax, not part of the key, and a reader concatenates the chunks before verifying. Keep the whole thing as one TXT record on the one selector name. Two separate TXT records on the same selector name are a different, invalid arrangement — receivers may read only one of them.

Fix 2 — If your panel splits automatically, let it — and verify it did

Some panels split long TXT values automatically — Cloudflare’s FAQ describes the split as expected DNS behaviour, with each chunk in double quotes and the receiver concatenating them back together. If yours does, paste the full value once and then verify with dig as in Step 0: the returned record will show the value in quoted chunks, and the concatenated p= must equal the generated key exactly. A quote in the middle of the displayed value is normal DNS behaviour, not corruption — Cloudflare’s FAQ says so explicitly.

Fix 3 — If your panel truncates silently, use CNAME DKIM or a different DNS host

Some panels cannot hold a 2048-bit TXT value at all. In that case the clean fixes are: use your provider’s CNAME-based DKIM if it offers one (Microsoft 365 DKIM is CNAME-based, which sidesteps the TXT length entirely), or move the domain’s DNS to a host that handles long TXT values. Dropping to a 1024-bit key is a last resort — it works, but it is a security downgrade taken because of a panel limitation, and it should be recorded as such, not presented as equivalent.

Advertisements

Prove it worked

  1. Re-query the selector with dig TXT and confirm the concatenated p= value matches the generated key character for character, including its full length.
  2. Send a test message to an outside mailbox and confirm dkim=pass with your domain in header.d=.
  3. If you use key rotation, confirm the same check for the new selector before retiring the old one — our DKIM rotation guide covers that order.

Still not working? Work this ladder in order

  1. dig shows the full key but DKIM still fails. The key is not the problem any more: check the selector name (a doubled domain in the host field is a classic), the v=DKIM1; k=rsa; prefix, and whether signing has been switched on at the provider.
  2. dig shows two separate TXT records on the selector. Delete one and merge the value into a single record as in Fix 1; a selector must have one key record.
  3. The panel will not save the split value. It does not support multi-string entry. Use Fix 3 (CNAME DKIM or a capable DNS host) rather than fighting the panel.
  4. The key matches but only some mail fails. A second signer (another service, an old selector) is involved. Check each service’s selector separately.

Mistakes that make it worse

  • Creating two TXT records for one selector instead of one record with split strings.
  • Adding spaces inside the key value, which become part of the record and break the character-for-character match.
  • Deleting the quote characters a panel added automatically, thinking they are corruption.
  • Rotating keys repeatedly into the same truncating panel.

FAQ

Why 255 characters?

Because a DNS TXT record is built from character-strings of at most 255 octets each (RFC 1035). Longer values must be split into several strings in the same record; readers join them back together.

Are the quotes in the middle of my record an error?

No. Each string is shown quoted, so a split value legitimately displays as "first part" "second part". That is the correct, expected form.

Is 1024-bit DKIM still acceptable?

It still verifies, and providers offer it where a DNS host cannot hold a 2048-bit key. But 2048-bit is the recommended length where supported, so treat 1024-bit as a fallback for a panel limitation, not as the default choice.

Sources

RFC 1035 — DNS TXT character-strings, 255-octet limit · RFC 6376 — DKIM key records · Cloudflare — DNS FAQ (why a TXT value shows a quote in the middle; concatenation on read) · Google Workspace Help — Set up DKIM (2048-bit vs 1024-bit choice) · Google Workspace Help — Troubleshoot DKIM issues (255-character limit; split the key into quoted strings, one after another) · Microsoft Learn — How to use DKIM for email in your custom domain (CNAME records in Microsoft 365) · Merroway — DKIM key rotation guide.

Verification note: record values, limits and procedure order on this page were checked against the official sources listed above on 12 November 2026.