Websites · Glossary
What is a TXT record?
A TXT record is a DNS record that stores plain text against a name in your domain. Services read it to confirm you control the domain, and mail systems read it for sender rules such as SPF, DKIM and DMARC. It changes nothing about where your website or email is hosted; it only publishes text anyone can look up.
Most people meet TXT records when a service asks them to prove they own a domain. You paste a value at your DNS provider, the service looks it up, and once the text matches, you are verified.
Indunil Asanka · Co-founder
4 min read · Published
| Use | Name it sits at | What the value looks like |
|---|---|---|
| Domain ownership check | The apex or a named label such as _service | A token the service gives you, such as a long random string |
| SPF (who may send your mail) | The apex | v=spf1 include:mail.example -all |
| DKIM (mail signing key) | selector._domainkey | v=DKIM1; k=rsa; p=<public key> |
| DMARC (what to do with failures) | _dmarc | v=DMARC1; p=quarantine; rua=mailto:<address> |
| Search console or analytics verification | The apex | A verification string from the tool |
What a TXT record is
DNS stores different record types against each name in a domain: A records for addresses, MX records for mail servers, CNAME records for aliases, and TXT records for arbitrary text. The TXT type was defined in the original DNS specification, RFC 1035, as a place for descriptive text. Over time it became the standard way for other systems to publish settings and proofs in DNS, because every domain owner can add one and anyone can look it up. A name can hold several TXT records at once, and each can contain one or more text strings of up to 255 characters.
How verification works
A service that needs to know you control a domain generates a token and asks you to add it as a TXT record, either at the apex or at a specific label it names. When you click Verify, the service queries DNS for that name and compares what comes back with the token it expects. If they match, it concludes that whoever can edit your DNS asked for the connection. Some services keep checking periodically, so deleting the record later can undo the verification. Using a dedicated label, such as an underscore name, keeps verification tokens apart from your email settings at the apex.
When it matters
TXT records matter whenever you connect a domain to something new: a website host, an email provider, a search console, a newsletter tool. They matter most for email. Without SPF, DKIM and DMARC records, mail sent in your domain's name is more likely to land in spam or be rejected. A small business that sends invoices and quotes from its own domain should check these three records once and keep a note of what each one does.
Common mistakes
Publishing two separate SPF records at the apex, which makes both invalid; SPF must be one record. Adding quotation marks twice because the dashboard already adds them. Pasting a verification token at the apex when the service asked for a label such as _service, or the reverse. Deleting old TXT records during a tidy up without knowing which service still checks them. Expecting a TXT record to point traffic anywhere. And testing seconds after saving, before the change has reached the resolver you are asking.
Where it shows up in OneCraft
Connecting a custom domain to a OneCraft site starts with a TXT record at _onecraft followed by your host name, plus a CNAME, then a Verify step; after verification a managed certificate is issued for the host. Apex hosts need an ALIAS or ANAME record instead of a CNAME. Custom domains are a paid plan feature: Starter 1, Pro 5, and Pro+ and up no cap. Mail a site sends, such as a newsletter to confirmed subscribers, goes out from OneCraft's address with the site's name, so your domain's own SPF and DMARC records are not involved.
Questions people ask
How do I check a TXT record?
Use a DNS lookup tool or a terminal. On most computers, dig TXT example.com or nslookup -type=TXT example.com shows the TXT records at that name. Online lookup tools give the same answer and often query several resolvers, which shows whether a new record has spread yet.
Can I have more than one TXT record?
Yes. A name can hold many TXT records, and it is common for the apex to carry several verification tokens alongside SPF. The exception is SPF itself: there must be only one SPF record per name, so combine every sending service into a single v=spf1 line.
Is it safe to publish a TXT record?
Yes. TXT records are public by design and anyone can read them. Never put a password or a private key in one. Verification tokens are safe to publish, because they only prove that the person editing your DNS asked for the connection; they do not grant access to anything.
Why is my TXT verification failing?
Usually the record is at the wrong name, the value has extra quotes or spaces, or the change has not reached the service's resolver yet. Check the exact name the service asked for, compare the value character by character, and try again after the record's TTL has passed.
Can I delete a verification TXT record after verifying?
Sometimes. Some services verify once and never look again, while others check periodically and will drop the connection if the record disappears. Read the service's help page before deleting, and keep a short list of which TXT record belongs to which service so a tidy up never breaks one.
Make one with websites
The button opens the generator with this use case already described. Change the wording to match your own.
Create a website with OneCraftRelated questions
- What is an apex domain?What is an apex domain? The bare domain with no subdomain, why it cannot hold a CNAME record, and how ALIAS, ANAME and CNAME flattening solve that.
- What is a managed SSL certificate?What is a managed SSL certificate? One your host issues, validates and renews for you, compared with buying and installing a certificate yourself.
- What is a CNAME record?What is a CNAME record? A DNS entry that points one name, like www.yourdomain.com, at another name. What it does, why builders ask for one, and the apex catch.
- What is an A record?What is an A record? The DNS entry that points a domain name at an IPv4 address. How it differs from a CNAME and when a website builder needs one.
Written and checked by the OneCraft team. Last checked .