TXT Record

Text

Type code
16
Status
In use
Defined in
RFC 1035

What the TXT record is for

RFC 1035 defined TXT for descriptive text with no fixed meaning. In practice it became the place to publish small pieces of structured data without needing a new record type.

Email authentication uses it heavily: SPF policies sit in TXT at the domain, DKIM keys at <selector>._domainkey.<domain>, and DMARC policies at _dmarc.<domain>. Many services also ask you to add a TXT record with a token to prove you control a domain.

A single TXT record contains one or more strings, each up to 255 bytes. Applications such as SPF join the strings of one record together; separate TXT records at the same name stay separate.

Wire format and fields

FieldSizeMeaning
TXT-DATAvariableOne or more character-strings.

Each character-string is a length byte followed by up to 255 bytes of data, so longer text has to be split into several strings within the same record.

Zone file syntax

<owner> <ttl> IN TXT "<string>" ["<string>" ...]

Example

The TXT records at google.com, fetched from live DNS on 27 November 2026:

google.com. 300 IN TXT "v=spf1 include:_spf.google.com ~all"
google.com. 300 IN TXT "google-site-verification=wD8N7i1JTNTkezJ49swvWW48f8_9xveREV4oB-0Hf5o"
google.com. 300 IN TXT "MS=E4A68B9AB2BB9670BCE15412F62916164C0B20BB"

Three of the seventeen TXT records google.com returned.

Common mistakes

  • Pasting a string longer than 255 bytes (often a DKIM key) as one string. It has to be split into several quoted strings in the same record.
  • Splitting one SPF policy across two TXT records instead of two strings in one record. Two v=spf1 records make SPF evaluation fail with a permanent error.
  • Doubling or losing quotes when entering values through a DNS provider's web form, so the published string contains literal quote characters.
  • Adding a TXT record at a name that has a CNAME, where it is never seen.
  • Leaving years of old verification tokens in place, which grows the response until it needs TCP or gets truncated.

Specifications

  • RFC 1035: Domain names - implementation and specification
  • RFC 7208: Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1 (Requires SPF policies to be published in TXT and defines how multiple strings in one record are joined.)
  • IANA DNS Resource Record (RR) TYPEs registry: type code and status

Related record types

Domain Intelligence APIs

Get started with our easy-to-use API docs.