[ DNS & domains ]

TXT record-length and label-length errors in DNS control panels

Distinguish TXT string limits, DNS label limits and record boundaries before shortening or splitting an authentication value.

By the EmailAuth research team

[ Key points ]

  • Measure encoded octets for each distinct DNS structure.
  • Split TXT strings within one record without creating multiple SPF policies.
  • Preserve intended key and policy bytes; test actual published boundaries.
On this page

A DNS form's length error can refer to several different limits. A long TXT value, a single name label and an entire DNS name are not measured in the same way. Shortening a DKIM key or splitting one SPF policy into separate records can turn an input problem into an authentication failure.

Identify which object is too long

References: RFC 1035 §2.3.4, RFC 1035 §3.3, RFC 1035 §3.3.14, RFC 2181 §11.

RFC 1035 limits a DNS label to 63 octets and the full wire-format name to 255 octets including its length fields and terminating root label. Presentation punctuation and Unicode input can obscure those measurements. Count the encoded DNS form, not just what a browser text box displays. Do not apply the hostname character rules blindly to service labels containing underscores.

TXT RDATA consists of one or more character strings, each with a one-octet length and therefore a maximum of 255 octets. That is not a blanket 255-character limit for the entire TXT record. A provider can support a longer record by storing several strings within it, subject to DNS message and service limits.

Split strings without splitting policies

References: RFC 7208 §3.3, RFC 7208 §4.5, RFC 6376 §3.6.2.1, RFC 6376 §3.6.2.2.

For SPF, strings within one TXT record are concatenated without extra spaces. Preserve required spaces at the split boundary. The fixture "v=spf1 ip4:192.0.2.10" " -all" reconstructs one policy. Two separate TXT resource records each beginning v=spf1 are not a supported way to extend it; SPF selects multiple policies and returns a permanent error.

DKIM key data also needs its intended value preserved. Use the provider's documented long-TXT entry method, not manual truncation. Do not split a long selector label by inserting a dot: that changes the DNS name queried by the verifier unless the actual selector configuration is changed consistently.

Run boundary-focused fixtures

References: RFC 1035 §2.3.4, RFC 1035 §3.3.

Create strings of exactly 255 ASCII a octets and 256 ASCII a octets. A single DNS character string can encode the first and cannot encode the second. A record containing two strings of 128 octets each is a different, valid string structure totaling 256 data octets. These markers are not authentication policies.

For names, compare a 63-octet ASCII label with a 64-octet label, then independently test full wire-name length. Preserve the validation error for each rejected case. In a separate test zone, publish one SPF record with two strings, then the intentionally invalid two-policy-record variant. Capture authoritative RR boundaries before and after the corrected one-record publication. Expected application outcomes are single-policy processing versus multiple-policy permerror.

These fixtures specify boundary behavior. A local encoding test can demonstrate lengths but cannot prove a DNS provider accepts a form, a live zone publishes the intended RRset or a receiver authenticates a message. Those execution results must be captured separately.

Verify the resulting wire data

References: RFC 7208 §3.3, RFC 6376 §3.6.2.2.

Query the exact owner and type at all active authorities. Use a DNS parser that preserves each resource record and its string list. Reconstruct values according to the consuming protocol rather than joining every output line. Then compare a relevant recursive answer and test the mail flow.

If the form still rejects valid data, capture the exact error and consult its current provider-specific limit. Do not add broad SPF authorization, weaken a key or create another policy as an expedient workaround. The correct fix preserves both the intended bytes and the DNS structure.

Executed parser and RRset evidence

The retained historical capture from 7 November 2026, inspected but not rerun for this review, records that the dnspython parser accepted a 63-octet label and a 255-octet wire name, and rejected the corresponding 64- and 256-octet cases with length exceptions. Actual UDP authority captures show the before state as two separate SPF TXT records, then the corrected state as one TXT record containing two ordered strings. A loopback forwarder returned the same boundaries. This is a local controlled publication, not a provider-panel change. SPF permerror for the two-policy case remains a source-defined expected result because no SPF evaluator was executed. The boundary and record-capture evidence should not be mistaken for live delivery proof.

Keep the evidence scope explicit

The archived parser and DNS captures are preserved unchanged. This review checks their recorded outcomes and separately calculates byte boundaries locally; it does not repeat UDP publication, run an SPF evaluator or test a provider form. The two-record SPF outcome is normative expectation, not captured authentication execution.

[ Takeaway ]

Measure encoded octets for each distinct DNS structure. Split TXT strings within one record without creating multiple SPF policies. Preserve intended key and policy bytes; test actual published boundaries.

[ By role ]

What this means for you

Choose your role for practical next steps.

IT / Mail Admin

Measure the right unit

Labels, TXT strings and whole records have different boundaries.

Next steps

  1. Measure encoded labels and strings separately.
  2. Preserve one-record boundaries.
  3. Capture before-and-after authoritative data.

CISO / SecOps

Preserve authentication semantics

A formatting repair must retain the intended identity, key and policy bytes.

Next steps

  1. Reject weakened keys and broad policy shortcuts.
  2. Review changes to selector identities.
  3. Keep local checks separate from live proof.

Founder / Non-technical

Avoid destructive shortcuts

Input limitations do not justify weakening keys or broadening authorization.

Next steps

  1. Require a structural diagnosis before workaround.
  2. Keep provider limitations documented.
  3. Protect the intended authentication design.

[ FAQs ]

Frequently asked questions

Is an entire TXT record limited to 255 octets?

No. That is the limit for each character string within TXT data.

RFC 1035 §3.3 RFC 1035 §3.3.14

Can two strings make one record?

Yes. Preserve their order and the application’s concatenation rules.

RFC 7208 §3.3 RFC 6376 §3.6.2.2

Can two SPF records extend one policy?

No. Multiple selected SPF policies cause permerror.

RFC 7208 §4.5

Are label length and TXT length the same limit?

No. A DNS label is limited to 63 octets; a TXT string to 255.

RFC 1035 §2.3.4 RFC 1035 §3.3

Does counting displayed Unicode characters suffice?

No. Limits apply to encoded octets and the DNS representation.

RFC 1035 §2.3.4

Can I shorten a DKIM public key to fit?

No. That changes or corrupts the key material.

RFC 6376 §3.6.1

Can adding a dot fix a long selector safely?

Not by itself. It changes the queried DNS name.

RFC 6376 §3.6.2.1

What evidence proves the repair?

Correct authoritative RR boundaries and reconstructed bytes, followed by relevant recursive and mail tests.

[ Sources ]

Sources

  1. RFC 1035

    Sections §2.3.4 · §3.3 · §3.3.14

  2. RFC 2181

    Sections §11

  3. RFC 7208

    Sections §3.3 · §4.5

  4. RFC 6376

    Sections §3.6.1 · §3.6.2.1 · §3.6.2.2

[ Glossary ]

Glossary

DNS label
One component of a DNS name, limited to 63 octets in the ordinary label format.

RFC 1035 §2.3.4

TXT character-string
A length-delimited string with at most 255 data octets; a TXT record contains one or more strings.

RFC 1035 §3.3 RFC 1035 §3.3.14

Enterprise provenance

Why top financial institutions and governments retired their email security dashboards.

Traditional email authentication platforms sell you a dashboard and ask your engineers to do the labour. In high-stakes environments, manual oversight means delayed enforcement, configuration drift and unmonitored shadow domains.

EmailAuth is the agentic email provenance platform. Our agents enforce p=reject, keep third-party senders aligned and move your domains to full RFC 9989 compliance, the new DMARC standard,, with human-in-the-loop auditability.

Governments Large enterprises Tier-1 financial institutions

SaaS · Dedicated tenancy · Air-gapped on-prem · BYOK encryption

Knowledge Base