[ DNS & domains ]

DNS TXT records: quoting, multiple strings and record boundaries

Preserve the difference between one TXT record containing several strings and several independent TXT records when publishing email authentication.

By the EmailAuth research team

[ Key points ]

  • One TXT record can contain several ordered character strings.
  • SPF joins strings without adding spaces and does not merge separate policies.
  • Verify bytes and owner names, then verify the actual mail path.
On this page

A DNS editor can display several quoted fragments without creating several records. Conversely, two rows can look like one policy to a person while remaining two independent records to a receiver. Check both the exact value and the record boundary before declaring an authentication record correct.

Read the DNS representation

References: RFC 1035 §3.3, RFC 1035 §3.3.14, RFC 7208 §3.3.

RFC 1035 defines TXT data as one or more character strings. Each string is limited to 255 octets, not necessarily 255 displayed characters. A longer value can occupy several strings within one record. The application defines how that data is interpreted. For SPF, RFC 7208 explicitly requires concatenating strings within a record without inserting spaces.

Quotation marks in zone-file presentation delimit strings. They are not automatically literal quotation marks in the DNS value. A provider's form may expect raw text, quoted zone-file syntax or a structured list of strings. Follow its documented input format and inspect the resulting answer rather than adding or removing quotes until the screen looks familiar.

Preserve spaces and independent records

References: RFC 7208 §4.5.

If an SPF value is split just before a mechanism, retain the separating space inside one of the strings. Two adjacent strings containing v=spf1 and ip4:192.0.2.10 -all would reconstruct as an invalid token sequence without that space. In this malformed example the reconstructed prefix is v=spf1ip4, which is not a valid SPF version token. If no other record is selected as an SPF policy, the SPF result is none. Preserve the exact application syntax instead of assuming every TXT consumer handles whitespace identically.

Do not join separate TXT records merely because a parser returns them in one collection. Multiple unrelated TXT records at the same owner are normal. Multiple records selected as SPF policies at that owner are not: SPF returns a permanent error rather than merging their authorization lists. Preserve the full answer and the application's selection rule in the diagnosis.

Reproduce a boundary test

Synthetic zone fixture A contains one record: example.com. 300 IN TXT "v=spf1 ip4:192.0.2.10" " -all". Reconstruct its strings in order without adding bytes. Expected SPF text is v=spf1 ip4:192.0.2.10 -all. The documentation address is illustrative and must not be used to authorize a production sender.

Fixture B replaces A with two records: example.com. 300 IN TXT "v=spf1 ip4:192.0.2.10 -all" and example.com. 300 IN TXT "v=spf1 ip4:192.0.2.20 -all". Expected SPF selection is multiple policy records and a permanent error. Fixture C retains A and adds example.com. 300 IN TXT "site-verification=synthetic"; the unrelated verification record is not an additional SPF policy.

Load each fixture separately in an isolated test zone. Query dig @AUTH example.com. TXT +norecurse, substituting the lab authority for AUTH. Preserve one resource-record object per returned record and its ordered string list. A faithful harness should distinguish A from B even if its display wraps long output. These are expected outcomes, not reported live tests.

Verify the published value

Compare the editor input, each authoritative answer and a recursive answer. Check the owner name for an accidentally repeated zone suffix. Use a DNS library that preserves record structure when automating checks; a line-oriented text scrape can confuse wrapping with record boundaries.

Retain the previous value and approval before a production change. After publication, test the relevant mail path with harmless content and capture authentication evidence. Correct TXT syntax establishes a DNS prerequisite; it does not prove that a service signs messages or that a receiver accepts them.

Keep the evidence scope explicit

Local string concatenation confirms the preserved space produces v=spf1 ip4:192.0.2.10 -all; omitting it produces the unselected v=spf1ip4 prefix. This is a text/selection illustration, not an executed SPF evaluator or live DNS query.

[ Takeaway ]

One TXT record can contain several ordered character strings. SPF joins strings without adding spaces and does not merge separate policies. Verify bytes and owner names, then verify the actual mail path.

[ By role ]

What this means for you

Choose your role for practical next steps.

IT / Mail Admin

Compare bytes and record boundaries

The string fragments inside a record and the separate records in an answer must remain distinguishable.

Next steps

  1. Inspect ordered strings and record boundaries.
  2. Test duplicate-policy and split-string fixtures.
  3. Compare authoritative and recursive answers.

CISO / SecOps

Protect the policy publication path

The meaningful control is authorized, verifiable DNS data rather than a reassuring screenshot.

Next steps

  1. Review who may alter authentication DNS.
  2. Require exact before-and-after evidence.
  3. Separate syntax checks from message proof.

Founder / Non-technical

Treat DNS publication as a service change

A small formatting mistake can interrupt mail even when the provider setup looks complete.

Next steps

  1. Require a tested publication checklist.
  2. Name the owner of each sending service.
  3. Keep recovery approval available.

[ FAQs ]

Frequently asked questions

Is 255 octets the maximum TXT record size?

No. It is the per-character-string limit; one TXT record can contain several strings, subject to DNS size constraints.

RFC 1035 §3.3 RFC 1035 §3.3.14

Does SPF insert spaces between strings?

No. Include every required space in the actual strings.

RFC 7208 §3.3

Can two SPF records be combined by a receiver?

No. Multiple selected SPF records cause a permanent error.

RFC 7208 §4.5

Can unrelated TXT records coexist?

Yes. Applications select records according to their own syntax and owner name.

RFC 7208 §4.5

Should I paste quote characters into a DNS form?

Use the provider’s documented input format, then inspect the actual DNS value.

Can a wrapped display prove there are two records?

No. Inspect resource-record boundaries rather than visual line breaks.

Why is the record at the wrong name?

Some editors append the zone suffix to relative names. Query the intended fully qualified owner.

Does a correct TXT lookup prove DMARC passes?

No. Authentication and alignment must be observed on a representative message.

RFC 9989 §5.3.5

[ Sources ]

Sources

  1. RFC 9989

    Sections §5.3.5

  2. RFC 7208

    Sections §3.3 · §4.5

  3. RFC 1035

    Sections §3.3 · §3.3.14

  4. ISC BIND dig reference

    Sections Syntax, -x reverse lookup, norecurse query option

[ Glossary ]

Glossary

TXT character-string
A length-delimited string with up to255 data octets; a TXT RR contains one or more such strings.

RFC 1035 §3.3 RFC 1035 §3.3.14

Record boundary
The distinction between separate resource records and the strings within one record; SPF selection does not merge separate policies.

RFC 7208 §3.3 RFC 7208 §4.5

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