A DNS TXT record is a DNS record that stores text for a domain. Today, it is mostly used to prove domain ownership and to publish email authentication records (SPF, DKIM, and DMARC).
Check any domain’s TXT records with our TXT record lookup.
What Is a DNS TXT Record?
A DNS TXT (text) record is a resource record within the Domain Name System designed to hold unformatted text strings. When defined in early internet specifications, TXT records provided a location for human-readable notes, contact details, or system descriptions associated with a hostname.
Over time, security and messaging standards adapted this record type for automated consumption. Modern mail servers, cloud providers, and certificate authorities query TXT records to read machine-readable security policies, cryptographic keys, and ownership tokens.
Unlike address records, TXT records do not direct network traffic or connect users to an IP address. Instead, they publish operational metadata that external systems query and evaluate. A single domain can publish multiple TXT records on the exact same hostname without conflict.
To learn more about foundational zone records, explore our guide on what is a DNS record and our complete index of DNS record types.
DNS TXT Record Format
In standard DNS zone files, a TXT record follows an established structure:
example.com. 3600 IN TXT “v=spf1 include:_spf.google.com ~all”
The components of this entry operate as follows:
- Name (example.com.): The domain or subdomain the record applies to.
- TTL (3600): Time to live in seconds, telling resolving nameservers how long to cache the text string.
- Class (IN): Internet class, used by almost all public domain configurations.
- Type (TXT): Identifies the resource record as text.
- Value (“v=spf1…”): The actual text data enclosed in quotation marks.
DNS dashboards often simplify this into Host, TTL, and Value fields. When configuring the host, @ typically denotes the apex or root domain, while prefixes like _dmarc, _mta-sts, or selector._domainkey targets specific subdomains. Most DNS management dashboards append your apex domain automatically. Entering _dmarc.example.com into a host field can inadvertently create _dmarc.example.com.example.com, breaking resolution.
The 255-Character Limit and String Splitting
Per DNS specifications (RFC 1035), a single character string within a TXT record cannot exceed 255 octets (characters). When publishing long entries, such as 2048-bit DKIM public keys or detailed SPF policies, you must split the payload into multiple quoted strings inside the same record:
example.com. 3600 IN TXT “v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Y…” “…remainder of public key string…”
Receiving resolvers automatically concatenate these adjacent strings back together without adding whitespace. Split long values automatically with our DNS record splitter.
DNS TXT Record Examples
Modern internet standards use TXT records across email delivery, routing security, and identity proofing. The table below lists eight common implementations:
| Use Case | Host | Example Value | Learn More |
|---|---|---|---|
| SPF | @ | v=spf1 include:_spf.google.com ~all | Read our guide on the SPF record |
| DKIM | selector1._domainkey | v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQE... | Understand public key setup for DKIM |
| DMARC | _dmarc | v=DMARC1; p=quarantine; rua=mailto:[email protected] | Learn how to publish a DMARC record |
| BIMI | default._bimi | v=BIMI1; l=https://example.com/logo.svg; a= | Showcase verified logos using BIMI |
| MTA-STS | _mta-sts | v=STSv1; id=20261001 | Enforce TLS transport with MTA-STS |
| TLS-RPT | _smtp._tls | v=TLSRPTv1; rua=mailto:[email protected] | Track encryption issues via TLS-RPT |
| Google Workspace Verification | @ | google-site-verification=abc123xyz | Review requirements for Google TXT records |
| Microsoft 365 Verification | @ | MS=ms12345678 | Verify tenant domain ownership |
DMARC policy flags like p, rua, and pct are detailed further in our comprehensive DMARC record documentation.
Common Uses of DNS TXT Records
Email Authentication: SPF, DKIM, DMARC, and BIMI
Email authentication relies almost entirely on DNS TXT records to stop impersonation and protect brand reputation.
Sender Policy Framework (SPF) uses a TXT entry published at the root domain to declare which mail servers and IP addresses are permitted to deliver messages on your behalf. Mail delivery agents query this record during delivery to detect forged origins and help organizations stop spoofing emails.
DomainKeys Identified Mail (DKIM) publishes cryptographic public keys at designated selector hostnames. Receiving servers retrieve these keys to verify cryptographic signatures applied to outgoing email headers, proving that messages were neither altered nor forged in transit. You can review step-by-step key publication in our DKIM setup guide.
Domain-based Message Authentication, Reporting, and Conformance (DMARC) aligns SPF and DKIM authentication. Published at _dmarc, it instructs receiving mail providers how to handle unauthenticated messages through monitoring, a quarantine policy, or strict rejection.
Complementary standards expand on this foundation. Brand Indicators for Message Identification (BIMI) links to verified brand marks displayed in supporting webmail interfaces, while MTA-STS and TLS-RPT mandate encrypted transport tunnels and report connection failures.
Domain Ownership Verification
Third-party web applications and SaaS platforms require proof of domain control before delegating administrative access. Services such as Google Workspace, Microsoft 365, search consoles, and public certificate authorities generate unique verification tokens during setup.
Publishing the generated string inside an apex TXT record confirms administrative access to the underlying DNS zone. Because only authorized domain owners can manipulate DNS zone files, this proves tenant authority without altering website routing or hosting configurations.
Other Uses
TXT records also support operational automation and certificate lifecycle management. Automated certificate systems like Let’s Encrypt use _acme-challenge TXT records for DNS-01 validation, proving domain control before issuing free TLS certificates. Other enterprise platforms use TXT tokens to verify webhook destinations, route third-party services, and store administrative notes.
How to Add a DNS TXT Record
Accessing Your DNS Settings
Log in to your domain registrar, hosting control panel, or cloud DNS management provider where your authoritative nameservers reside. Navigate to the DNS zone management dashboard for your target domain.
Adding the Record
- Click Add Record and select TXT from the record type dropdown.
- Enter the Host or Name. Use @ for your apex domain, or input the specific subdomain prefix (such as _dmarc or your DKIM selector). Do not type the full domain name if your provider appends it automatically.
- Paste the provided string into the Value or Content field. Enter the value cleanly without adding extra quotation marks unless your DNS interface explicitly requires manual string quoting.
- Set the TTL (Time to Live). A value of 3600 (one hour) is standard, while 300 (five minutes) works well when testing new records.
- Save or publish your changes.
Propagation Time
DNS updates do not reflect globally at once. Resolving nameservers continue serving their cached copy until the previous TTL expires.
Most TXT record updates propagate across primary resolvers within minutes, though full worldwide propagation can take up to 48 hours depending on provider caches. Track how changes spread using our DNS propagation checker, or learn more about cache behavior in our guide on how long DNS updates take.
How to Check DNS TXT Records
Online
Auditing records using web tools allows you to inspect resolving values without using local terminal environments. You can inspect your domain’s live configuration using our dedicated TXT record lookup tool. To review all published zone records simultaneously, query your domain through our complete DNS record lookup.
Command Line
You can also query records directly from your operating system terminal:
Using dig on Linux and macOS:
dig TXT example.com +short
To query a specific subdomain record like DMARC:
dig TXT _dmarc.example.com +short
Using nslookup on Windows, macOS, or Linux:
nslookup -type=TXT example.com
Using PowerShell on modern Windows systems:
Resolve-DnsName example.com -Type TXT
TXT Record Rules and Common Mistakes
While DNS allows substantial flexibility, several structural rules govern TXT configurations:
- Publish only one SPF record per domain: Domains may host dozens of separate TXT records on the root, but you must never publish more than one SPF record (v=spf1). Publishing multiple SPF records causes resolving mail servers to return an SPF PermError, causing authentication to fail. Combine all sending sources into a single line.
- Keep DNS lookups under the SPF limit: SPF policies cannot require more than 10 DNS lookups across all include, a, mx, and ptr mechanisms. Keep your lookup usage within limits using our SPF lookup counter.
- Split strings exceeding 255 characters: If a continuous text string exceeds 255 characters without quotation breaks, some DNS providers reject the update or truncate the value, corrupting cryptographic DKIM keys.
- Avoid typographical quotes: Copying and pasting records out of word processors or documentation systems often introduces curly or smart quotes (“ ”). DNS systems require plain ASCII quotes (” “).
- Prune obsolete verification strings: Remove legacy domain verification tokens once cloud providers or software migrations are retired to keep zone files clean and manageable.
Frequently Asked Questions
What’s the difference between a DNS TXT record and a CNAME record?
A TXT record stores arbitrary text data used for authentication, metadata, and domain verification. A CNAME record creates an alias that maps one domain name to another canonical domain name, redirecting lookups rather than holding text information directly.
Can a domain have multiple DNS TXT records?
Yes. A single domain or hostname can host multiple TXT records simultaneously. For example, your root domain can host an SPF record alongside separate verification tokens for Google and Microsoft. However, you must never publish multiple SPF records on the same hostname.
Do TXT records affect website speed or performance?
No. Web browsers query A and AAAA address records to locate web servers and render web pages. They do not request or parse TXT records during normal page navigation, meaning TXT entries have zero impact on website loading speeds.
Is there a length limit for TXT records?
Yes. Individual strings inside a TXT record cannot exceed 255 characters. Values exceeding this limit must be split into multiple quoted strings within the same record entry. Modern resolvers automatically join these adjacent strings back together into a continuous block without spaces.
How do I verify a DNS TXT record is live?
You can verify whether a TXT record has propagated by testing the hostname in our free TXT record lookup or by running dig TXT example.com +short in your command line. If the output returns your intended string, the record is active.
Final Words
DNS TXT records have evolved from basic administrative notes into a central mechanism for email security, identity verification, and web service integrations. From publishing SPF, DKIM, and DMARC policies to validating SSL certificates and corporate software suites, correct TXT record formatting protects your digital domain from spoofing and misconfigurations.
Maintaining continuous visibility over your published records ensures that policy changes and stale entries do not undermine deliverability or brand trust.
Monitor Every Record on Every Domain
Failing checks ranked by severity with fix steps, look-alike domain alerts, SSL and domain expiry tracking, and branded PDF and CSV reports for SOC 2, ISO 27001, and PCI DSS audits, all in one dashboard.