Free auditStart free
GlossaryGlossary · Technical SEO

TXT record

A TXT record is a DNS record that holds text for a domain. See what it's used for, such as SPF and Search Console verification, with examples and common mistakes.

4 min
read
6
sources
Oct 21, 2026
updated
Scaplet Editorial Team
author
In one line

A TXT record is a DNS resource record that holds text for a domain name. RFC 1035 says TXT records "are used to hold descriptive text" and that the meaning of the text depends on the domain where it is found. Common uses today include proof of domain ownership and email authentication settings such as SPF and DKIM.

30-second check

Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode

At a glance

4 facts from the sources below
TXT (type 16)
Record type
RFC 1035, section 3.3.14
Defined in
One or more quoted text strings
Content
255 octets
Max per string
01Explained

What a TXT record is

DNS maps names to data. An A record maps a name to an IP address and an MX record names a mail server. A TXT record maps a name to free-form text. RFC 1035 defines its data as one or more character strings, and says the semantics of the text depend on the domain where it is found.

Because DNS has no built-in meaning for that text, other systems agree on formats and put them there. RFC 1464 describes one such convention, an attribute name and value separated by an equals sign, as in "printer=lpr5". Cloudflare's docs describe the content as one or more text strings delimited by double quotes.

02At a glance

What TXT records are used for

Use

SPF (which servers may send mail for your domain)

What the record looks like
example.com. TXT "v=spf1 +mx a:colo.example.com/28 -all"
Source
RFC 7208 says SPF records MUST be published as a DNS TXT record
Use

DKIM public keys

What the record looks like
A TXT record at selector._domainkey.example.com
Source
RFC 6376 says keys are stored in a subdomain named _domainkey
Use

Domain ownership checks

What the record looks like
A unique string issued by the service you are verifying with
Source
Google Search Console offers TXT or CNAME for Domain properties
Use

Certificate issuance checks

What the record looks like
A token placed in DNS to prove control of the domain
Source
Cloudflare says TXT records are most commonly used to demonstrate domain ownership before issuing SSL/TLS certificates
03How it works

Add a TXT record for Search Console

Google says DNS verification is required only for a Domain property such as example.com, not URL-prefix properties. Here is the flow Google documents.

Google tells you to pick CNAME instead when a CNAME record is found at the domain whose target is a parent domain of the one you entered. If no CNAME record is found, which Google calls the most common case, use TXT. See Google Search Console for what the verified property unlocks.

  1. 01

    Choose TXT in Search Console

    When verifying your Domain property, choose TXT for the record type. Search Console gives you a string value to use.

  2. 02

    Add it at your DNS host

    In your domain provider's DNS records, create a TXT record. Google says to leave the Host/Name blank or set it to "@", as your provider's documentation describes, and to paste the Search Console string as the Value.

  3. 03

    Go back and verify

    Click Verify in Search Console. Google says manually installed records can take up to two or three days for your provider to start serving, so if it fails, wait a day or two and try again.

04Worth knowing

Mistakes and limits

Two SPF records

RFC 7208 says a domain must not have multiple records that would cause an SPF check to select more than one. Merge them into a single v=spf1 record.

Long values

A single string is capped at 255 octets. Per RFC 7208, a record may contain several quoted strings, which are concatenated without spaces, so long values are split into pieces. Most DNS dashboards do this for you.

Inconsistent quotes

Cloudflare warns that mismatched double quotes cause a validation error. If you save TXT content without quotes there, it adds them.

Record size

RFC 7208 advises keeping the SPF record small enough that the query result fits in 512 octets, and notes that other TXT records at the same name count toward the reply size.

Removing the verification record

Google says that to stay verified, don't remove the DNS record from your provider, even after verification succeeds.

05Check it

Check a TXT record

Query the name where the record should live. SPF and verification strings sit at the domain itself, and DKIM keys sit under _domainkey.

Look up TXT records
dig +short TXT example.com
dig +short TXT selector._domainkey.example.com
Questions

Asked a lot.

4 questions people ask next, answered from the sources on this page.

01What is a TXT record used for?

To attach text to a domain name. Common uses are SPF and DKIM email authentication, domain ownership verification for services like Google Search Console, and proving control of a domain before a certificate is issued.

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

A CNAME makes one name an alias of another name. A TXT record holds text and points nowhere. Google's Search Console flow accepts either as a verification method: use CNAME if a CNAME exists whose target is a parent domain of your domain, and TXT otherwise.

03Can a domain have more than one TXT record?

Yes. Many services each add their own. The exception is SPF: RFC 7208 does not allow multiple records at one name that an SPF check would select.

04How long is a TXT record allowed to be?

Each character string in the record can be up to 255 octets. RFC 7208 explains that a record with several strings is read as one concatenated value, which is how longer text is stored.

Sources · 6

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • rfc-editor.org
  • google.com
  • cloudflare.com
  1. 01RFC 1035: Domain names, implementation and specificationrfc-editor.org · checked 2026-10-25
  2. 02RFC 7208: Sender Policy Framework (SPF)rfc-editor.org · checked 2026-10-25
  3. 03RFC 1464: Using the Domain Name System to store arbitrary string attributesrfc-editor.org · checked 2026-10-25
  4. 04Verify your site ownership (Search Console Help)support.google.com · checked 2026-10-25
  5. 05Cloudflare DNS: DNS record typesdevelopers.cloudflare.com · checked 2026-10-25
  6. 06RFC 6376: DomainKeys Identified Mail (DKIM) signaturesrfc-editor.org · checked 2026-10-25
Free · 2 minutes

Know the term. Now check your site.

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • +212% organic clicks in 90 days Ledgerly