A TXT record is a DNS record that stores arbitrary text data. It was originally designed for human-readable information (e.g., admin contact details) but is now the standard container for machine-readable authentication and verification data.
Common Uses
| Purpose | Example Value |
|---|---|
| SPF | v=spf1 include:_spf.google.com ~all |
| DKIM public key | v=DKIM1; k=rsa; p=MIGfMA0G... |
| DMARC policy | v=DMARC1; p=reject; rua=mailto:[email protected] |
| Domain verification | google-site-verification=abc123xyz |
| BIMI logo | v=BIMI1; l=https://example.com/logo.svg |
Multiple TXT Records
A domain can have multiple TXT records at the same hostname — they coexist and are all returned in a DNS query. Exception: only one SPF record is allowed (RFC 7208); two SPF records cause a PermError.
Record Length Limits
Each string in a TXT record is limited to 255 characters. Long values (like DKIM public keys) are split into multiple quoted strings, which DNS resolvers concatenate:
example.com TXT "part1_of_long_value" "part2_of_long_value"
Querying TXT Records
dig TXT example.com
dig TXT _dmarc.example.com
dig TXT google._domainkey.example.com