TXT record
Learn what a DNS TXT record is, its versatile uses for email authentication (SPF, DKIM, DMARC), domain verification, common formats, lookup methods, and best practices to avoid common pitfalls.
TL;DR
A TXT record stores arbitrary text strings associated with a domain name.
It's one of the most flexible DNS types and is widely used for:
TXT values are quoted strings (up to 255 chars each); multiple strings concatenate automatically.
When queried, all TXT records for a name are returned.
Resolvers concatenate multiple strings into one value (no extra spaces added).
TXT is "unstructured" applications interpret the content (e.g., SPF parsers look for v=spf1).
dig example.com TXTnslookup -type=TXT example.comNAME TTL CLASS TYPE VALUE
example.com. 3600 IN TXT "v=spf1 include:_spf.google.com ~all"Basic SPF
example.com. TXT "v=spf1 include:_spf.google.com ~all"Long SPF (split strings)
example.com. TXT "v=spf1 include:_spf.google.com include:mailgun.org" "include:sendgrid.net ~all"DMARC policy
example.com. TXT "v=DMARC1; p=quarantine; pct=100; rua=mailto:dmarc-reports@example.com"Domain verification
example.com. TXT "google-site-verification=ABC123XYZ789abcdef"DKIM public key (selector-based)
selector._domainkey.example.com. TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD..."| Feature | TXT | A / AAAA | MX |
|---|---|---|---|
| Purpose | Arbitrary text / config | IP address mapping | Mail server routing |
| Email auth support | Yes (SPF/DKIM/DMARC) | No | Yes (delivery) |
| Multiple allowed | Yes | Yes | Yes |
| Root domain | Yes | Yes | Yes |
| Structured parsing | Application-specific | No | Priority-based |
→ See also: MX Record, A Record
Related: MX Record · A Record · DNS Basics