A TXT record is a DNS entry that holds a piece of text instead of an address. Its original purpose was human-readable notes, but today it is how you prove to services that you control a domain, and how you publish the rules that stop others sending email pretending to be you.
How TXT records are read
A TXT record has a name, a value in quotes and a TTL. Any service can look it up publicly, the same way it would look up an address. A single string inside a TXT record is limited to 255 characters, so long values such as DKIM keys are split into several quoted chunks that are joined when read. Most DNS dashboards handle the splitting for you.
The four jobs TXT records usually do
- Ownership verification. Google Search Console, Microsoft 365, Meta and many others give you a unique string to add. When they find it, they know you control the domain.
- SPF. A record on the bare domain starting
v=spf1lists which servers may send mail for you, for examplev=spf1 include:_spf.google.com ~all. - DKIM. A public key published at a name like
selector._domainkey.example.com, which receivers use to check the signature on your outgoing messages. Some providers have you add it as a CNAME instead. - DMARC. A policy at
_dmarc.example.com, such asv=DMARC1; p=none; rua=mailto:[email protected], telling receivers what to do with mail that fails SPF and DKIM.
Example: getting newsletters into inboxes
A boutique starts sending a monthly newsletter through an email platform, and many messages land in spam. The platform's setup page lists a DKIM record and an SPF include to add. The owner merges the include into her existing SPF record rather than adding a second one, adds the DKIM entry and a basic DMARC record. Since 2024, Gmail and Yahoo have required bulk senders to authenticate this way, so these records now matter even for modest lists.
When a small business needs them
If you use email on your domain, you need SPF, DKIM and DMARC; your provider's instructions will tell you the exact values. You will add verification TXT records whenever a tool asks you to prove ownership. Incoming mail routing is handled separately by your MX records.
TXT record mistakes
- Two SPF records. Only one
v=spf1record is allowed per name; a second makes SPF fail entirely. - Too many includes in SPF. SPF allows at most 10 DNS lookups, and each tool's include uses some of them.
- Deleting old verification strings that are still in use. Some services recheck periodically and disconnect if the record disappears.
- Adding stray quotes or spaces. Paste values exactly as given; a copied line break can break the whole record.
Related terms
- DNS records: the other types TXT works alongside.
- MX record: routes incoming mail while TXT protects outgoing mail.
- CNAME: sometimes used for DKIM in place of TXT.
- DNS propagation: why a verification may fail for the first few minutes.