What is a TXT record? Verification codes, SPF and DKIM in one type

By TechCompare · Updated · How we check

TXT records hold free text, and each service finds its own by a prefix like v=spf1 or google-site-verification=. A name can carry many of them, but only one may be an SPF record.

A TXT record stores plain text on a DNS name. DNS doesn't care what the text says, so it became the place for anything a service needs to read from your domain: codes that prove you own it, the SPF list of mail servers, DKIM public keys and DMARC policies. One name can hold many TXT records, and each service picks out its own.

Topic
TXT records
Text and verification
Category
Record types
What each record does

How this is calculated

Each TXT record is made of one or more strings, and each string can be at most 255 bytes long. That limit goes back to the original DNS spec (RFC 1035), where every string starts with a single length byte. Longer values, like a 2048-bit DKIM key, get split into several strings inside the same record. SPF and DKIM readers join those strings back together with nothing in between, so a split in the middle of a key does no harm.

Where a record sits matters as much as what it says. SPF lives on the domain itself. DMARC lives at _dmarc.example.com. DKIM keys live under _domainkey, at a name like google._domainkey.example.com. Verification codes from search engines, email providers and SaaS tools usually go on the domain itself, which is why a busy domain can carry a dozen TXT records at once.

The DNS Lookup lists every TXT record at a name with its TTL. It joins split strings so long keys read as one value, and it pulls the SPF and DMARC records out of the list and explains them.

Verdict

Add a TXT record whenever a service asks you to prove you own a domain, and leave old codes in place until you're sure nothing reads them. Keep exactly one SPF record on the domain, put DMARC and DKIM at their own names, and let your DNS host split long values. Then look the name up and check that the text matches what you entered.

More DNS scenarios

SPF vs DKIM vs DMARC
SPF checks the sending server, DKIM checks the message, and DMARC ties both to the From address.
View details
MX records
How senders find your mail servers, what the priority number does, and the null MX for domains that take no mail.
View details
CNAME vs A record
An A record points a name at an address. A CNAME points it at another name, with rules that trip people up.
View details

Frequently asked questions

Can a domain have more than one TXT record?
Yes. A name can hold as many TXT records as you need, and each service picks out its own by the text it starts with. The one rule is for SPF: there must be only one record that starts with v=spf1, or receivers stop with a permanent error and SPF can't pass.
Why is my TXT record split into several quoted strings?
Each string in a TXT record holds at most 255 bytes, so DNS hosts split longer values like DKIM keys into chunks. The chunks belong to one record and are read back as one value. Some dashboards show the quotes and some hide them, but the record is the same.
Can I delete old verification TXT records?
Only once you're sure the service no longer checks them. Some services look for the code again later and drop your verified status when it's gone. If you can't tell which service a code belongs to, the text before the equals sign usually names it.