What Is a TXT Record?
A TXT record is a type of DNS record that stores text-based data. Originally designed for human-readable notes, TXT records are now primarily used for email authentication (SPF, DKIM, DMARC) and domain ownership verification.
How TXT Records Are Used
TXT records are the backbone of email authentication in DNS. They store the data that receiving mail servers need to verify the legitimacy of incoming emails:
- SPF records — Published at the domain root, listing authorized sending servers. Example:
v=spf1 include:_spf.google.com -all - DKIM records — Published at
selector._domainkey.domain.com, containing the public key for signature verification. - DMARC records — Published at
_dmarc.domain.com, defining authentication policy and reporting addresses. - Domain verification — Services like Google Workspace, Microsoft 365, and others use TXT records to verify domain ownership.
Why TXT Records Matter
Without TXT records, email authentication would not exist in its current form. SPF, DKIM, and DMARC all rely on TXT records to publish their configuration in DNS. Incorrect or missing TXT records directly cause email authentication failures, deliverability problems, and security vulnerabilities.
TXT Record Size Limits
A single TXT string can be up to 255 characters. For longer values (common with complex SPF records), DNS allows multiple strings to be concatenated within one TXT record. Most DNS providers handle this automatically when you enter a value longer than 255 characters.
Frequently Asked Questions
What are TXT records used for?
TXT records are used for SPF (authorized email senders), DKIM (email signing keys), DMARC (authentication policies), domain verification, and other security-related purposes.
Can a domain have multiple TXT records?
Yes. Multiple TXT records at the same domain are common. However, you should only have one SPF record per domain — multiple SPF records cause PermError. DKIM and DMARC use specific subdomains, so they do not conflict.
What is the maximum length of a TXT record?
A single string can be up to 255 characters, but DNS allows multiple strings to be concatenated within one record, enabling much longer values.