technical · sourced answer
DNS TXT Record: Definition and Email Use Cases
A DNS TXT record is a type of Domain Name System resource record that allows a domain administrator to insert arbitrary text into the DNS. In the context of email, TXT records are primarily used to store authentication data for SPF, DKIM, and DMARC to verify sender identity.
Mechanical Function
TXT records function as key value pairs stored on a DNS server. When a receiving mail server receives an email, it queries the DNS of the sending domain for specific TXT records. The server retrieves the text string associated with the record and parses it according to the protocol being checked, such as looking for the v=spf1 prefix to identify SPF rules.
Importance for Senders
TXT records are critical for email deliverability because they provide a mechanism for domain owners to prove ownership and authorize specific IP addresses or services to send mail on their behalf. Without these records, receiving servers cannot verify the authenticity of the sender, which often leads to messages being flagged as spam or rejected entirely.
Common Operational Mistakes
Common errors include exceeding the 255 character limit for a single string, which requires splitting the record into multiple strings. Other frequent mistakes include having multiple SPF records on one domain, which is a violation of the standard and causes authentication failure, or including syntax errors like missing quotes or incorrect prefixes.
Concrete Examples
An SPF record is a TXT record that looks like v=spf1 ip4:1.2.3.4 include:_spf.google.com ~all. A DMARC record is a TXT record located at the _dmarc subdomain, such as v=DMARC1; p=quarantine; rua=mailto:admin@example.com. You can verify your current records using the free tools at https://sendhq.cc/tools.
Domain Verification
Beyond email authentication, TXT records are used for general domain ownership verification. Services like Google Search Console or Microsoft 365 require users to add a unique, randomly generated string as a TXT record to prove they control the DNS settings of the domain before granting access to administrative services.
Questions teams ask
Can a domain have more than one TXT record?
Yes, a domain can have multiple TXT records. However, for specific protocols like SPF, you must consolidate all authorized senders into a single TXT record.
What is the character limit for a TXT record?
A single string in a TXT record is limited to 255 characters, but multiple strings can be concatenated to reach a total limit of 2048 characters.
How long does it take for a TXT record to update?
Updates depend on the Time to Live (TTL) setting of the record, typically ranging from a few minutes to 48 hours across the global DNS system.
Primary sources
- RFC 7208: Sender Policy Framework — RFC Editor
- RFC 7489: Domain-based Message Authentication, Reporting and Conformance — RFC Editor
- Cloudflare DNS Documentation — Cloudflare