All Glossary Terms

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

Try the Tool →

Frequently Asked Questions

What is an SPF record and how does it relate to TXT records?
An SPF (Sender Policy Framework) record is a type of TXT record that lists the IP addresses and hostnames authorized to send email for a domain. It starts with "v=spf1" and is published as a TXT record at the domain root. Receiving mail servers query this record to verify whether incoming email came from an authorized source.
Can a domain have more than one TXT record?
Yes, a domain can have multiple TXT records, and this is very common. For example, a domain might simultaneously have a TXT record for SPF, a DMARC policy, a Google site verification token, and a Microsoft 365 verification token — all at the same hostname. Each is a separate TXT record entry.
What is the difference between SPF, DKIM, and DMARC?
SPF specifies which servers are allowed to send email for a domain. DKIM adds a cryptographic signature to emails that receivers can verify using a public key in DNS. DMARC builds on both, allowing domain owners to publish a policy (none, quarantine, or reject) for handling emails that fail SPF or DKIM checks and requesting aggregate reports from receivers.
How long can a TXT record be?
A single TXT record string is limited to 255 characters, but multiple strings can be combined in one TXT record entry. DNS resolvers concatenate these strings, effectively allowing TXT records of several kilobytes. This is necessary for long DKIM public keys, which frequently exceed the 255-character limit.