What Is a DNS TXT Record?

Category: Domains & DNS ยท Updated 2026-11-08

A TXT record is a type of DNS record that stores a block of text attached to a domain or subdomain, instead of an IP address or a mail server name. Services use TXT records to verify that someone controls a domain or to publish email authentication rules such as SPF, DKIM and DMARC, since the DNS system gives a quick, public place to check a short piece of text.

What a TXT record looks like

Like other DNS records, a TXT record has a name (the domain or subdomain it applies to), a type (TXT), a time to live (TTL), and a value. The value is one or more text strings enclosed in quotation marks. A simple example added at the root of a domain:

Name: example.com
Type: TXT
Value: "v=spf1 include:_spf.example.net -all"
TTL: 3600

Unlike an A record, which must contain a valid IP address, a TXT record can contain almost any text, which is why it has been reused for so many different purposes over the years.

Common uses for TXT records

UseWhat it does
SPFLists which mail servers are allowed to send email for the domain
DKIMPublishes a public key used to verify a cryptographic signature on outgoing email
DMARCTells receiving mail servers what to do when SPF or DKIM checks fail
Domain ownership verificationProves control of a domain to services like Google Search Console, Microsoft 365 or a CDN
Miscellaneous notesSome tools store short configuration values or version tags in a TXT record

Adding and checking a TXT record

TXT records are added in the same DNS zone editor used for A, CNAME and MX records, usually in your domain registrar's or hosting provider's control panel. After adding one, changes can take anywhere from a few minutes to 24-48 hours to fully propagate, depending on the TTL and caching along the way. You can check whether a record is live using the dig command on Linux or macOS, or an online DNS lookup tool:

dig TXT example.com +short

# or, for a subdomain used by a specific service
dig TXT _dmarc.example.com +short

Rules and limits to know

  • A single TXT string is limited to 255 characters; longer values are automatically split into multiple quoted strings that are concatenated when read.
  • A domain can have many TXT records for different purposes (SPF, DKIM with different selectors, site verification), but should have only one SPF record; adding a second one breaks SPF checking entirely.
  • The exact text, including spacing and quotation marks, usually has to match what the requesting service expects, so copy values exactly rather than retyping them.
  • Record changes are not instant, so verification steps that check a TXT record right after you save it can fail until DNS has propagated.

TXT record vs. other DNS record types

An A record points a name to an IPv4 address and a CNAME record points a name to another name; both are used for actually routing traffic. A TXT record carries no routing information at all, it just stores text for other systems to read, which is why it never conflicts with A or CNAME records on the same name, but can conflict with another TXT record meant for the same specific purpose, such as two SPF values.

Frequently asked questions

What does TXT stand for in DNS?

TXT simply stands for "text." It is a DNS record type designed to hold a block of text rather than an IP address or a server name.

Can a domain have more than one TXT record?

Yes, a domain can have many TXT records for different purposes, such as one for domain verification and another for DKIM. The exception is SPF, where a domain should have exactly one SPF TXT record, since two cause SPF validation to fail.

How long does it take for a new TXT record to work?

Most changes are visible within a few minutes to a few hours, though full propagation across all DNS caches can take up to 24-48 hours in rare cases. Checking with a tool like dig shortly after saving the record is a reliable way to confirm it is live.

Is a TXT record public?

Yes. Like other DNS records, a TXT record can be looked up by anyone using standard DNS tools. Sensitive secrets should not be stored in a TXT record, since it is not a private channel.

What is the difference between a TXT record and a CNAME record?

A CNAME record points one domain name to another domain name for routing purposes, while a TXT record only stores text for verification or informational use and does not affect how traffic is routed.

Do I need quotation marks when adding a TXT record?

Most DNS control panels handle the quoting automatically when you paste the value into the record's value field, but when editing a zone file directly, the text value must be wrapped in double quotation marks.

Related topics