Skip to main content

What’s the 255-character limit and how to handle it?

The 255-character limit is per string within a TXT record:

Why the limit: DNS protocol uses a single byte to indicate string length. Maximum value is 255.

Handling long records:

Split into multiple strings that get concatenated

"v=spf1 ... first part" "... second part ~all"

Best practices:

Let your DNS provider handle splitting when possible.

If manual, split at logical boundaries (between mechanisms).

Avoid splitting in the middle of a word or parameter.

Test the resulting record to ensure proper concatenation.

DKIM special case: 2048-bit DKIM keys always need splitting. ESPs usually provide pre-split values.

Large documents split into multiple file pages. The reader assembles them in order.