Skip to content
WebsiteHosting.com

concept Domains & DNS

DNS TXT record

A DNS TXT record holds textual data at a DNS owner name.

Sources checked · P0031

What it means

DNS TXT records publish text data associated with a DNS owner name. Applications such as SPF interpret some TXT records according to their own syntax, but DNS does not combine all TXT RRsets into one universal policy. A TXT record can contain multiple character strings, and multiple TXT records at one name are different records. TXT wire format SPF rules

Try it

Example — inspect a synthetic TXT RRset. Change the consumer from domain verification to SPF and watch which values are considered. Select the split-SPF fixture to see two chunks form one value; select two SPF records to see the consumer reject the duplicate policy. Edit the short ASCII token locally, then use Inspect TXT records and Reset. Nothing is looked up or published.

TXT records: one RDATA or several?

Choose which application consumes the TXT RRset, then inspect chunks without merging different records.

Example
verification: verify=demo-123

The verification consumer ignores unrelated TXT values; text storage is public and is not a place for secrets.

TXT records: one RDATA or several?: evaluated fixture values
ObservationModel value
Record count2
Chunks of selected exampleverify=demo-123
Joined RDATANot applicable: 2 independent TXT records
Individual RDATA valuesrecord 1: verify=demo-123 | record 2: v=spf1 -all
Consumer matches1
TXT records: one RDATA or several?: local scenario parameters

Local, bounded educational fixture. No DNS, mail, certificate, network, socket or external request is performed.

About this model

One TXT record can contain multiple character-strings; consumers concatenate those strings without adding spaces. Distinct TXT records remain distinct. This bounded ASCII teaching parser does not make DNS queries.

See the article’s protocol sources and model limits. The scene does not alter a real system.

How the mechanism works

In a DNS zone, an RRset groups records by owner, class and type. Consider example.com TXT with "verify=demo-123" and separately "v=spf1 -all". A verification service may look for a value beginning verify=, while an SPF evaluator looks for exactly one applicable v=spf1 record for the selected identity. The values can coexist because the consumers have different rules. By contrast, "v=spf1 " "-all" within one RDATA is interpreted as v=spf1 -all: the space belongs to the first character-string, not a separator automatically supplied by DNS.

A TXT character-string is at most 255 octets. Long TXT RDATA may comprise more than one such string; 255 is not a blanket length limit for the entire record or its RRset. Quoting and escaping depend on the zone-file or DNS-provider interface. Treat a provider UI's visual line break separately from the on-wire RDATA structure. When copying a challenge token, check exact bytes and owner name, not appearance alone.

TXT record boundaries in a sample RRset

Suppose the authoritative answer at example.com contains two separate TXT RDATA values:

  • Record 1: "verify=demo-123" for a domain-verification service.
  • Record 2: "v=spf1 " "-all" — two strings inside one TXT record for an SPF evaluator.

The SPF consumer joins the second record's character-strings into v=spf1 -all, but it must not concatenate record 1 and record 2. Switch the example to two SPF records and the consumer has more than one candidate SPF policy; that is a configuration problem, not a longer SPF value. A provider's display that wraps a record onto two lines is insufficient evidence of two DNS records. Inspect the actual RDATA boundaries before editing or deleting any TXT value.

The owner name and the consumer are separate boundaries

A TXT value does not acquire an application meaning merely because its text looks familiar. For example, example.com TXT "verify=demo-123" and _proof.example.com TXT "verify=demo-123" are records at different DNS owner names. A verification service that queries the second name will not find a value placed only at the first; changing the string is not the same as changing the record's owner.

Likewise, an SPF evaluator selects records at the domain required by the SMTP identity it is checking; it does not join every TXT value beneath an entire zone. Ask which name, which TXT record, and which application rule are in play before diagnosing a missing token or removing another service's record. The lab only joins character-strings within a single record and applies its explicitly selected consumer. DNS record owner/type SPF record selection

In practice

Inspect the full authoritative RRset and distinguish the presentation of quoted chunks from separate records. Preserve unrelated TXT values when changing a specific policy. Validate the consuming application’s syntax against its current standard and the actual DNS output; stop before collapsing or deleting unrelated verification/authentication strings.

Limits and common mistakes

This teaching parser accepts bounded printable ASCII only and deliberately refuses arbitrary quoting, control characters and Unicode. Actual TXT content may have wider encodings and many service-specific validation rules. A TXT answer cannot by itself prove domain ownership, email deliverability or service health. If a provider shows different data than the authoritative zone, stop before deleting anything and first reconcile delegation, caches and UI representation.

Key takeaways

DNS stores records; each application decides what a TXT value means. Count records and character-string parts separately, and verify the consuming protocol before editing an apparently similar value.

Frequently asked questions

Editorial questions, answered from the sources listed for this article.

Do two TXT strings always mean two records?

No. Several quoted character-strings may form one RDATA, while separate DNS TXT resource records are independent. Confirm the record boundary in the authoritative answer.

Can two separate TXT records be joined into one SPF policy?

No. TXT character-strings are concatenated only within one RDATA. Two applicable SPF records at one owner name are independent records and are not a single longer policy.

Is TXT a special email-only record?

No. TXT carries text values used by different applications. Email authentication is one significant consumer, not the DNS definition of TXT.

Can I have multiple unrelated TXT records at the same owner?

Yes. However, each consumer protocol may constrain how many matching policy records are valid.

Sources & model boundaries

Primary references used for this explanation. The interactive example is an educational model, not a live check.

  1. Domain names — implementation and specification

    Resource-record RDATA formats (TXT §3.3.14, NS §3.3.11 and SOA §3.3.13). DNS wire/text RDATA, TXT/NS/SOA. Read applicable sections with later updates.

    Checked .

  2. Sender Policy Framework (SPF)

    DNS record selection and evaluation (§§3–4); mechanism results (§8). SPF identity, TXT assembly, multiple records, mechanisms, results and DNS-term limits; verify subsequent updates.

    Checked .