DNS Basics • Last Updated 3rd April 2026 3 min read

What is a TXT record?

Learn what a DNS TXT record is used for, what TXT records look like, and why they are so common in verification and email security setups.

Tools For This Topic

What a TXT record is

A TXT record is a DNS record that stores arbitrary text values. Despite its simplicity, it is one of the most widely used record types in modern DNS.

TXT records are commonly used for email authentication, domain verification, and service-specific configuration.

Many modern systems rely on TXT records to publish policies or prove ownership of a domain.

What a TXT record looks like

TXT records can contain simple strings or structured values interpreted by specific services.

example.com. 3600 IN TXT "v=spf1 include:spf.protection.outlook.com -all"
example.com. 3600 IN TXT "google-site-verification=example-token"
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=none; rua=mailto:dmarc@example.com"

Each of these examples serves a different purpose, but they all use TXT as the transport mechanism.

How TXT records are interpreted

TXT records themselves have no inherent structure or meaning. Their interpretation depends entirely on the system querying them.

For example, SPF, DMARC, and BIMI all use TXT records, but each defines its own syntax and rules.

This flexibility is why TXT records are so widely used across different services.

Common TXT record uses

  • SPF records for defining authorised mail senders
  • DMARC records for policy and reporting
  • DKIM public keys (published under selector-based hostnames)
  • Domain ownership verification for services like Google or Microsoft
  • Third-party service configuration and validation

Why TXT records matter so much

TXT records are often critical during service setup and validation workflows.

If a TXT record is missing, incorrect, or not yet propagated, verification processes may fail and services may not activate correctly.

Because of this, TXT lookups are frequently one of the first checks performed during troubleshooting and migrations.

Formatting considerations

TXT record values often require precise formatting, including correct spacing, separators, and quotation handling depending on the DNS provider.

Some DNS systems automatically wrap values in quotes, while others expect you to provide them explicitly.

Long TXT values (such as DKIM keys) may be split into multiple quoted strings but are treated as a single value when queried.

selector._domainkey.example.com. 3600 IN TXT "v=DKIM1; k=rsa;" "p=MIIBIjANBgkqh..."

What to check in practice

  • Whether the TXT record exists at the correct hostname
  • Whether the value matches exactly what the service expects
  • Whether multiple records conflict (e.g. multiple SPF records)
  • Whether the record has propagated across resolvers
  • Whether formatting (quotes, spacing, separators) is correct
# Query TXT records
nslookup -type=txt example.com

# Using dig
dig TXT example.com

# Query specific hostname
dig TXT _dmarc.example.com

Common mistakes

  • Publishing multiple SPF records instead of combining them
  • Typing verification tokens incorrectly
  • Incorrect spacing or formatting in structured values
  • Forgetting to remove obsolete verification records
  • Misunderstanding how different TXT records interact

Use These DNS Pro Tools

If you want to validate this topic in practice, these DNS Pro tools are the fastest next step.

Related Tools

Related Articles