What is a DNS TXT record?
The DNS ‘text’ (TXT) record lets a domain administrator enter text into the Domain Name System (DNS). Text is stored in the form of one or more strings within quotation marks.
Originally, the TXT record was intended as a place for human-readable notes. However, it is now also possible to put machine-readable data into TXT records. One domain can have many TXT records simultaneously.
Example of a TXT record
| Domain | Record Type | Value | TTL |
|---|---|---|---|
| @ | TXT | "This is an awesome domain! Definitely not spammy." | 32600 |
Today, two of the most important uses for DNS TXT records are email spam prevention and domain ownership verification, although TXT records were not designed for these uses originally.
What kind of data can go in a TXT record?
The original RFC only indicates that "text strings" go in the "value" field of a TXT record. This could be any text that an administrator wants to associate with their domain.
Most DNS servers will put a limit on how big TXT records can be and how many strings they can store, so administrators cannot use TXT records for large amounts of data.
- Size Limit: Strings are typically limited to 255 bytes.
- Concatenation: Applications often do not care about the difference between individual strings and will just join them together, treating multiple strings as a single continuous string.
The 'Official' Format for Storing Data
In 1993, the Internet Engineering Task Force (IETF) defined a format for storing attributes and their corresponding values within the 'value' field of TXT records. The format is simply the attribute and the value contained within quotation marks (") and separated by an equal sign (=):
"attribute=value"
Examples from RFC 1464 (1993):
- Host:
host.widgets.com| Value:@TXT "printer=lpr5" - Host:
sam.widgets.com| Value:@TXT "favorite drink=orange juice"
While this definition was considered experimental and isn't always adopted, many modern protocols (like DMARC) follow a standardized formatting within these records. Regardless of the format, TXT records always store their content within quotation marks ("").
How TXT Records Help Prevent Email Spam
Spammers often try to fake or forge the domains from which they send their messages. TXT records are a key component of several email authentication methods that help an email server determine if a message is from a trusted source.
Common Email Authentication Methods:
- SPF Records: SPF TXT records list all the servers that are authorized to send email messages from a domain.
- DKIM Records: DKIM works by digitally signing each email using a public-private key pair. This helps verify that the email is actually from the domain it claims to be from. The public key is hosted in a TXT record associated with the domain.
- DMARC Records: A DMARC TXT record references the domain's SPF and DKIM policies. It should be stored under the title
_dmarc.example.com. The 'value' is the domain's DMARC policy.
By configuring these records, domain operators can make it more difficult for spammers to spoof their domains and can track attempts to do so.
How TXT Records Help Verify Domain Ownership
While not an initial feature, domain ownership verification has been adopted by many webmaster tools and cloud providers.
By uploading a new TXT record with specific information or editing a current one, an administrator can prove they control that domain. The tool or cloud provider checks the TXT record to see if it has been changed as requested. This is similar to confirming an email address by clicking a link, proving you own the address.
Secure Your Professional Identity
In 2026, properly configured TXT records are essential for any business. Whether you are setting up a Reliable Email Provider or protecting your brand in markets like the USA or India, these records are your first line of defense.
Would you like me to help you generate a specific SPF or DMARC TXT record for your domain to improve your email deliverability?