Skip to content
dnscheck.app

Glossary

TXT Record: Definition, Format and Common Uses

What a TXT record is

A TXT record stores text in DNS. Its data is one or more character-strings. The text is descriptive. Its meaning depends on the domain where it appears and on the application reading it. A resolver (the software that asks DNS questions for a client) requests it with a domain name plus the query type TXT. RFC 1464 proposes TXT for carrying new kinds of information without changes to most existing DNS servers. Cloudflare uses it, for example, for certificate validation.

How a TXT record is written

Part Example
Owner name example.com.
TTL (seconds a cache may keep it) 3600
Class IN
Type TXT
Text "example-verification=abc123"

The token below is fictional.

example.com. 3600 IN TXT "example-verification=abc123"

Azure DNS describes a TXT record set (all TXT records at one name) as a list of TXT records. The TTL applies to every record in the set. Most DNS servers require a backslash or double quote inside the text to be backslash-escaped. Some DNS server implementations limit the size or number of TXT records at one name, and some may not support TXT at all.

Text does not have a fixed format. RFC 1464 proposes a "name=value" string, which applications may follow. The first unquoted equals sign separates name from value. Applications decide whether whitespace in the value matters.

host.example.com. 3600 IN TXT "printer=lpr1"

In RFC 1464 attribute lookups, names match case-insensitively. Records with no unquoted = or an empty name are ignored.

Common uses and where to add one

TXT records are not only for email. Microsoft 365 asks an admin verifying a Google Workspace domain to add a TXT record with a value Microsoft supplies. Cloudflare's domain control validation (DCV) needs a TXT record in the hostname's authoritative DNS, with the name and content Cloudflare gives. For email authentication, see SPF record.

Add the record at the DNS host used by the domain's authoritative nameservers, the servers that hold its records. With custom nameservers, use that provider. Microsoft's source advises against changing nameservers or transferring the domain just to verify it. The record only proves ownership. It does not move registration or DNS hosting, and it does not redirect email. Microsoft says the change usually takes effect within a few minutes but might take up to 48 hours. Caches keep an answer until its TTL expires, so use the propagation checker to see the current state.

Cloudflare's documentation says DCV records can be removed once the certificate is issued. Renewal may need them again. At renewal, Cloudflare tries automatic HTTP DCV only if the hostnames are proxied, resolve to the zone's assigned IPs, and the certificate has no wildcards. If those conditions are not met, renewal falls back to the chosen method and DCV must be repeated manually. Cloudflare suggests Delegated DCV for automatic renewal. This page cannot tell which other verification records a service still checks. Note the current record before deleting anything.

To read a domain's TXT records, run:

dig +short TXT example.com
"example-verification=abc123"

Windows: Resolve-DnsName -Name example.com -Type TXT. You can also look up the TXT records for your domain in the browser.

References