What Is a TXT Record and Why Is It Used to Verify a Domain?
A TXT record stores a short piece of text in your DNS zone. Here is how it proves domain ownership, what else it carries, and how to manage it safely.
10 min readUpdated Nov 19, 2026By XPASS Editorial Team

When you connect a domain to a new service, the first thing it often asks is a small favour: please add this line of text to your DNS. The line looks like a random string, and the control panel calls it a TXT record. It does not change where your website loads from and it does not move your email. Yet without it, many services will refuse to continue. This article explains what a TXT record is, why it became the standard way to prove you own a domain, and how to add, check and tidy these records without causing trouble.
You do not need to be a network engineer to follow along. If you can log in to wherever your domain's DNS is managed and copy and paste a value, you can do everything described here. The goal is that the next time a provider asks for a TXT record, you know exactly what you are publishing and why.
What a TXT record is
DNS, the Domain Name System, is the public directory that turns names into answers. Different record types hold different kinds of answers. An A or AAAA record holds an IP address, an MX record names the mail servers, and a CNAME record points one name at another. A TXT record is the general-purpose one: it holds text. The format is defined in the original DNS specification, RFC 1035, as one or more character strings attached to a name.
Because the content is only text, DNS itself does nothing with it. A browser loading your website never looks at it. A mail server delivering a message to you does not need it to find your inbox. TXT records exist so that other programs can look up a fact about your domain and decide what to do. That makes them useful for anything that needs a public, tamper-resistant place to publish a short statement.
Each TXT record has the same parts as other records:
- Name (host): where the record lives, such as the root of the domain, written as
@in many panels, or a subdomain such as_dmarc. - Type: TXT.
- Value: the text itself, often shown inside quotation marks.
- TTL: how long resolvers may remember the answer before asking again.
A single name can hold several TXT records at once. That is normal and expected, and it is why a busy domain often has a long list of them at the root.

Why TXT records prove you own a domain
Imagine a service that lets you send email from your own domain, or a search tool that shows you data about your site. Before it does so, it must be sure you are entitled to act for that domain. It cannot take your word for it, and it cannot read your registrar account. What it can do is check public DNS.
The logic is simple. Only someone who controls a domain's DNS zone can add records to it. So the service generates a unique value, shows it to you and asks you to publish it as a TXT record. A few minutes later it looks the record up. If the exact value is there, the person who requested verification must be able to edit that zone, which is strong practical evidence of control. If the value is missing or wrong, verification fails and you try again.
This approach has real advantages over alternatives such as uploading a file to your website or clicking a link sent to an address at the domain:
- It works even when the domain has no website yet.
- It does not depend on a particular mailbox existing.
- It leaves a visible trail in the zone that you can audit later.
- The same method works whichever company hosts your DNS.
The value is usually a long token, sometimes with a prefix that names the service. Treat it as an identifier, not as a secret you must hide. It is published to the whole internet the moment you add it. What matters is that you copy it exactly and place it on the correct name.
Other things TXT records carry
Verification is the best-known use, but not the only one. Several email and certificate systems were built on top of TXT records because DNS was already available everywhere.
| Use | Where it is published | What it says |
|---|---|---|
| Site or service verification | Root of the domain or a name the service specifies | A token proving you can edit the zone |
| SPF | Root of the domain | Which servers may send email for the domain, per RFC 7208 |
| DKIM | A name under _domainkey using a selector |
A public key used to check message signatures |
| DMARC | The _dmarc name |
A policy for messages that fail SPF or DKIM checks |
| ACME challenges | A name starting with _acme-challenge |
A temporary value that proves control when requesting a certificate by the DNS method in RFC 8555 |
This is why a domain used for business email often ends up with several TXT records even though no one added them for verification. They are the quiet plumbing of email authentication. If you handle mail for your domain, it is worth reading how the MX record for business email decides where messages are delivered, because TXT records and MX records work side by side: MX says where mail goes, and TXT records help receivers decide whether to trust it.
How to add a TXT record step by step
The exact screens differ between DNS providers, but the steps are the same everywhere.
- Get the exact value. The service that wants verification shows the host name and the value. Copy both. Do not retype them by hand.
- Open the DNS zone. Log in to the place that serves your domain's DNS. This may be your registrar, a hosting company or a separate DNS service. If you are not sure which one it is, look at the domain's name servers; whichever company they belong to is the one whose panel counts.
- Create a new record. Choose the type TXT.
- Fill in the host. If the service says the record goes on the root, enter
@or leave the field blank, depending on the panel. If it names a subdomain, enter only the part before your domain, for example_verify, not the full name, unless the panel's hint says otherwise. - Paste the value. Some panels add the quotation marks for you; others expect you to leave them out. If you see doubled quotes after saving, edit the record and remove the extra pair.
- Keep a short TTL while testing. A lower TTL means a wrong value gets corrected sooner. You can raise it later once everything works.
- Save, wait, then verify. Go back to the service and press its verify button after a few minutes.
If you use a registrar that also hosts DNS, the whole job is often a single page. You can check what your own domain offers on the domains page.
A worked example
Suppose you own example.com and want to prove it to an email service. The service shows:
- Host:
@ - Type: TXT
- Value:
service-verification=a1b2c3d4e5
You open your DNS panel and see the root of the domain already has two TXT records: an SPF line starting with v=spf1 and a token for another tool. You do not edit either. You add a third TXT record with host @ and the new value, and save.
Now the root name holds three separate TXT records. Anyone who asks DNS for the TXT records of example.com receives all three together. The email service asks the same question, spots its own token among them and marks the domain as verified. The SPF line and the other token continue to work exactly as before, because each TXT record is independent.
Notice what you did not do. You did not paste the new value into the SPF record, and you did not replace an existing record. Mixing unrelated values into one record is the most common beginner mistake, and it can break email delivery.
How to check that the record is live
Do not rely only on the green tick in your DNS panel. A panel tells you the record was saved; it does not tell you the world can see it. To confirm, query public DNS the way the verifying service will.
- Use a command line tool such as
dig example.com TXTornslookup -type=TXT example.com, or an online DNS lookup page, and look for your exact value in the answer. - Check the right name. A token published at
@will not be found if the service looks at a subdomain. - Compare character by character. A missing character, a stray space or a curly quote pasted from a document is enough to fail verification.
- Be patient with caching. Resolvers remember an answer until its TTL runs out, so a negative answer cached a minute ago may still be served. If a check fails right after you save, wait and test again before changing anything.
If the answer still does not show your value after the TTL has passed, the usual causes are a record saved on the wrong zone (for example at a company that is not actually serving your DNS) or a typo in the host field. Looking up the domain's name servers settles the first question quickly.
Limits and what to watch for
TXT records are simple, but a few rules cause most of the problems.
Length. A single character string inside a TXT record is limited to 255 characters. Longer values, such as some DKIM keys, are split into several strings within one record, and the receiver joins them. Most panels do this automatically; if yours does not, you may need to enter the value in chunks as its help page describes.
One SPF record only. A domain should publish a single SPF record. If you add a second one for a new email provider, receivers can treat the result as an error. Merge the new sender into the existing line instead.
CNAME conflicts. A name that has a CNAME record cannot carry other record types, including TXT. If a service wants a TXT record on a name that already holds a CNAME, you may need to ask the service for an alternative name. The page on the CNAME record for www explains why this exclusivity exists.
Do not delete blindly. Some services check the token again from time to time. Removing it can disconnect the domain from the service. Before you clean up, note down what each record is for. A comment in your own records is more reliable than memory.
Public by design. Anything in a TXT record can be read by anyone. Never put passwords, API keys or private information in one. Verification tokens are meant to be public, but only because they prove nothing beyond control of the zone.
Verification is not security. A TXT token proves you can edit DNS. It does not make the domain safe, and an attacker who gains control of your DNS account could add records too. Protect the account that manages your DNS with a strong password and a second factor.
Certificates. Another DNS record type, covered in the guide to the CAA record and SSL issuance, lets you say which certificate authorities may issue for your domain. It is separate from TXT, but both live in the same zone, so it helps to review them together.
A maintenance habit that saves time
Over the years a domain collects TXT records: tokens from tools you tried once, an old email provider, a certificate challenge that was never cleaned up. Once or twice a year, list the TXT records at the root and at the common mail names, and write a one-line purpose beside each. Anything you cannot explain deserves a search of your own accounts before you remove it. If nobody can find the service that uses it, removing it is usually safe, but do it one record at a time and keep a copy of the old value so you can restore it.
Also keep the people who manage your domain in the loop. When an agency or an IT contractor adds a record on your behalf, ask them to tell you what it is for. A short note in a shared document is enough, and it prevents the mystery lines that nobody dares delete.
Summary
A TXT record is a piece of text published in your domain's DNS. Systems read it to confirm facts about the domain, most often that you control it, and email authentication and certificate checks use the same mechanism. Add the exact value on the exact name, test it with a public DNS lookup, and be patient about caching. Remember the limits: keep to one SPF record, avoid CNAME conflicts, never publish secrets, and keep a note of what each record does.
When you are ready to manage records for your own name, the domains page shows what is available for registering and managing a domain.
Frequently asked questions
What is a TXT record in DNS?
A TXT record is a DNS entry that holds a short piece of free-form text for a name in your domain. It has no effect on where your website or email goes. Other systems read it to confirm facts about the domain, such as who owns it or which servers may send its email.
Why do services ask me to add a TXT record?
Only the person who controls a domain's DNS can add records to it. When a service asks you to publish a value it generated, and then finds that value in public DNS, it has reasonable evidence that you control the domain.
Can I have more than one TXT record on the same name?
Yes. A name such as the root of your domain can carry many TXT records, for example several verification tokens and one SPF record. The exception is SPF itself: a domain should publish only one SPF record, so changes must be merged into it.
Should I delete a verification TXT record after it works?
Not always. Some services re-check the record from time to time and may unlink the domain if it disappears. Read the provider's instructions before removing anything, and keep a note of what each record is for.
References
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Ready to register your domain?
Search a name, compare extensions and pay once for the years you choose.
.com registration from $18.81 for the first year
Search domainsKeep reading

Domain & DNS Guides
What Is an MX Record and Why Does Business Email Need One?
An MX record points incoming email for your domain to the right mail servers. Here is how it works, how to set it up step by step, and what can go wrong.
10 min read

Domain & DNS Guides
What Is a CAA Record and How Does It Control SSL Issuance?
A CAA record lets you name the certificate authorities allowed to issue SSL certificates for your domain. Here is how it works and how to avoid locking yourself out.
10 min read

Domain & DNS Guides
What Is a CNAME Record and How Do You Use It with www?
A CNAME turns one hostname into an alias for another. This guide shows how to use it for www, where it must not be used and how to test it.
10 min read