Skip to content
inetGeek

DNS TXT record

TXT

A TXT record holds free-form text. In practice it carries domain verification tokens and email authentication policy.

Check this on a domain with DNS Lookup →

01.

What a TXT record is for

A TXT record attaches arbitrary text to a name. DNS itself assigns no meaning to the contents — the meaning comes from whatever reads it.

Most TXT records in practice do one of two jobs: proving to a third party that you control a domain, or publishing email authentication policy such as SPF and DMARC.

02.

What a TXT record looks like

A TXT record holds quoted text at a name: example.com. 3600 IN TXT "v=spf1 include:_spf.example.net ~all". The quotes are part of the format rather than part of the value.

Nothing in DNS interprets what is inside. The structure that makes a string an SPF policy or a domain verification token belongs to whatever reads it, which is why one record type carries so many unrelated jobs.

03.

Character strings and the 255-byte limit

A TXT record is made of one or more character strings, and each string is limited to 255 bytes. A longer value is split across several strings within the same record.

Readers are expected to concatenate those strings with nothing between them. A value split in the wrong place, or joined with a space, produces a policy that looks right in a dashboard and fails in practice.

Splitting a TXT value255 bytes per string

0 bytes → 0 strings

    Illustrative value. A 2048-bit DKIM key is the usual reason a TXT value has to be split; the strings are stored separately and a reader concatenates them with nothing in between.
    04.

    Checking TXT records

    dig TXT example.com +short returns every TXT record at the name, one per line and still quoted. A record split into several strings comes back as several quoted pieces on one line, which is the format doing its job rather than a corrupted value.

    Records used by email standards usually sit at a subname rather than at the domain: DMARC at _dmarc.example.com, and DKIM under a selector at selector._domainkey.example.com. Asking for TXT at the domain alone will not show them.

    05.

    Multiple TXT records at one name

    Unlike a CNAME, a name may carry many TXT records, which is why several verification tokens can coexist on one domain.

    Some consumers require exactly one matching record, though. A domain must publish at most one SPF record, and two is a configuration error rather than a redundancy.

    Related records

    When these numbers change, hear about it. Sources are re-checked monthly; a repricing goes out as a short note.

    Confirm by email; unsubscribe from any issue. Your address goes to Kit and nowhere else — what we do with it.

    Every page here is sourced and dated.