Glossary
TXT Record
Stores arbitrary text data in DNS for verification and security
A TXT record (Text record) is a DNS record type that allows domain owners to store arbitrary human-readable or machine-readable text in DNS, most commonly used for domain verification, SPF email authentication, and DKIM public keys.
What is a TXT Record?
A TXT record is a DNS record type designed to hold free-form text data associated with a domain. Originally intended for human-readable notes, TXT records have evolved into one of the most important DNS record types for authentication, verification, and security purposes. Today, they are used for an enormous range of applications including email authentication protocols, domain ownership verification, and service configuration.
Some of the most common uses of TXT records include SPF (Sender Policy Framework) records that specify which mail servers are authorized to send email on behalf of a domain, DKIM (DomainKeys Identified Mail) public keys used to verify email signatures, DMARC policies that tell receiving servers how to handle emails failing SPF or DKIM checks, and domain verification tokens required by services like Google Search Console, Microsoft 365, and various CDN providers.
A single domain can have multiple TXT records, and they can coexist with other record types at the same hostname. TXT records at the zone apex (the root domain) are especially common for SPF and domain verification, while DKIM keys are typically published on subdomains like selector._domainkey.example.com.
How Does a TXT Record Work?
TXT records are stored in the DNS zone file like any other record type. When a system needs to check a TXT record — for example, when a receiving mail server wants to verify SPF — it performs a DNS TXT query for the domain. The resolver returns all TXT records at that hostname, and the requesting system parses the content for the relevant data.
For SPF, the receiving server reads the TXT record to determine which IP addresses are authorized to send mail for the domain. If the sending server's IP is not listed, the email may be rejected or marked as spam. For DKIM, the receiver fetches the public key from a TXT record and uses it to verify the cryptographic signature in the email header.
Domain verification works similarly: a service like Google asks you to add a specific TXT record with a unique token to prove you control the domain. Their system then performs a DNS lookup to confirm the record exists before granting access to their tools.
TXT records have a maximum length of 255 characters per string, but multiple strings can be concatenated in a single record, allowing longer values such as DKIM keys.
How to Check a TXT Record
To view all TXT records for a domain, use the TXT Lookup tool at nslookup.net/tools/txt-lookup. The tool queries live DNS and returns every TXT record published for the domain, which is useful when troubleshooting email delivery, verifying that an SPF or DMARC policy is correctly configured, or confirming that a domain verification token has been published and is visible to external services.
Related Tool
TXT Lookup