TXT records in practice: long values, quotes and several records on one name

Domains & DNS·· 10 views· 4 min read

The short answer: a TXT record holds text, and it is where SPF, DKIM, DMARC and the domain verifications for Google, Microsoft and many other services live. It looks like the simplest record, but it has rules that break e-mail without any error message: the size of each piece of text, the quotes, and above all the rule that a name can have only one SPF.

The TXT rules

Rule In practice
Each piece of text is at most 255 characters One TXT record can hold several pieces, each in quotes. For SPF and DKIM, readers join them with no space. That is how a long DKIM key fits.
A name can have several TXT records Normal and allowed: SPF and two or three service verifications can all sit on the domain.
A name can have only one SPF Two records starting with v=spf1 on the same name cause a permanent error, and SPF fails for every message. Everything goes into a single one.
Quotes Some editors add them for you, others expect you to type them. Doubled quotes, or curly quotes pasted from a document, spoil the value.
Semicolons In a zone file they often appear as \; (that is how the file stores them). In the panel’s editor you type them normally.
The name matters as much as the value SPF goes on the domain; DKIM on a name ending in ._domainkey; DMARC on _dmarc; each verification wherever the service says.
Copy and paste breaks values Line breaks, spaces in the middle of a DKIM key and curly quotes are the most common mistakes.

Adding a long TXT record without breaking it

1 Copy the value from the source as plain text: straight from the service’s page, or run it through a plain text editor first. Never from a Word document or a PDF.
2 In cPanel, open the Zone Editor, Manage next to the domain, Add Record and the TXT type. Enter the name the service gives you and paste the value in one go. Zone editors usually split long values into the 255-character pieces themselves.
3 If it is an SPF and one already exists, do not create another: edit the existing one and add what is missing (another include:, for example). See creating your SPF record, step by step.
4 Check what was published: dig example.com TXT +short
dig selector._domainkey.example.com TXT +short
dig _dmarc.example.com TXT +short
On a long value you will see the pieces separated by " ": that is normal, readers join them. (example: example.com is a domain reserved for examples, and 192.0.2.10 and 2001:db8::10 are documentation addresses; replace them with yours.)
5 Count the SPF records: the domain’s list may show only one line starting with v=spf1.
Two SPF records on one name is worse than it looks. Nothing adds up: receiving servers treat it as an error, and your SPF stops protecting the domain. It happens a lot when a new sending service is added and someone creates a new SPF instead of editing the existing one.
Before deleting an old verification TXT, check with the service whether it still needs it. Some services re-check the domain from time to time and disconnect if the record disappears. See TXT verification records.

SPF, DKIM or a verification will not pass and the TXT looks right? Tell us the domain and the service you are setting up.

Open a support ticket

SEE ALSO

Proving the domain is yours: TXT verification records

Creating your SPF record, step by step

Creating your DMARC record, and reading what it sends back

SPF, DKIM and DMARC: why your e-mail lands in spam

Forwarded e-mail lands in spam or bounces: why SPF breaks and what to do

Reading a whole DNS zone line by line: names, trailing dots, TTL and the @ sign

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from 5.940,00 Kz/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.