What are TXT records?
Still have a question, spotted an error, or have a better explanation or a source we should cite?
If you've ever set up SPF, DKIM, or DMARC, you've already created a TXT record. You might not have realized it, but those little strings of text you paste into your DNS settings? Those are TXT records.
A TXT record is a type of DNS record that stores text data against a domain name. That's really it. DNS has lots of record types with specific jobs (MX records route incoming mail, A records point to IP addresses), and TXT records are the general-purpose ones. They were originally designed to hold human-readable notes, but they ended up being incredibly useful for machine-readable data too.
Here's what a typical TXT record looks like in the wild:
tidalmail.com TXT "v=spf1 include:_spf.google.com ~all"
That's an SPF record. A receiving mail server reads that string and uses it to check whether the IP address that sent you an email was actually authorized to send on behalf of tidalmail.com.
Email authentication uses TXT records for three main jobs:
- SPF tells receiving servers which mail servers are allowed to send email from your domain.
- DKIM stores a public key that lets receivers verify your email's cryptographic signature.
- DMARC tells receivers what to do if SPF or DKIM checks fail (quarantine, reject, or just report back).
TXT records are also used outside of email. Services like Google Workspace ask you to add a TXT record to prove you actually own the domain before they let you use it. Same idea, different purpose.
Still a few practical things worth knowing. You can have multiple TXT records on the same domain (DKIM and DMARC and a verification string can all coexist). Each TXT string is technically limited to 255 characters, though most DNS providers handle longer records by concatenating multiple strings behind the scenes. You usually don't need to worry about that part.
If you want to dig into why email authentication landed on TXT records specifically (and not a purpose-built record type), that's a genuinely interesting bit of internet history. The short version is that it was the fastest way to get something working without waiting for new DNS infrastructure to be deployed worldwide.
Want to check whether your own TXT records are set up correctly? Our free SPF checker takes 30 seconds and tells you exactly what your domain is publishing.
Contributors
Who worked on this answer
Every name links to their profile. Every company links to their site. Real people, real accountability.