client-alerts-black-week-icon.svg

BLACK NOVEMBER SALE! Up to 60% off websites, hosting and VPS.    00 Days Days 00 Hours Hrs 00 Minutes Min 00 Seconds Sec

Back to Article List

What Is a DNS TXT Record? Format, Examples and Lookup

What Is a DNS TXT Record? Format, Examples & Lookup - What Is a DNS TXT Record? Format, Examples and Lookup

A DNS TXT record is a DNS entry that stores plain text against a domain name, so other services can read it. Today a TXT record is mostly used for two jobs: proving you own a domain (for Google, Microsoft 365 and similar services) and publishing email security rules such as SPF, DKIM and DMARC. If someone has asked you to "add a TXT record", this guide shows you what it is, what it looks like and exactly how to add and check one.

TXT record in one paragraph

A TXT (text) record is one of the standard DNS record types. It holds one or more strings of text, each up to 255 characters, published at a domain or subdomain such as example.co.za or _dmarc.example.co.za. DNS itself never acts on that text. Mail servers, verification tools and other systems look it up and decide what to do with it.

How a DNS TXT record works

Every domain has a DNS zone: a list of records that tells the internet where your website, email and other services live. An A record points to a server's IP address and an MX record says which servers accept your mail. A TXT record is different because it does not point anywhere. It simply publishes a note that anyone can read.

The process looks like this when a service checks your TXT record:

  1. You publish the text. You add the TXT record in the DNS settings for your domain, usually at your registrar or in your hosting control panel.
  2. A service asks for it. A mail server, Google Search Console or another tool queries DNS for TXT records at a specific name.
  3. DNS returns the strings. The authoritative nameservers for your domain answer with every TXT record at that name.
  4. The service interprets the value. A receiving mail server reads your SPF policy, or a verification tool compares the token with the one it gave you.

Because the record lives in DNS, only the person who controls the domain can create it. That is why a TXT record works so well as proof of ownership. If you manage your domain with us, the DNS editor that comes with our domain name registration lets you add TXT records yourself at no extra cost.

DNS TXT record format, explained field by field

Most DNS editors show the same handful of fields. Here is what each one means, using a typical SPF entry for example.co.za as the sample.

FieldExample valueWhat it means
Name / Host@ or example.co.zaWhere the record lives. "@" means the root domain. Use a label such as _dmarc for a subdomain.
TypeTXTThe record type. Pick TXT, not SPF (the old SPF record type is retired).
Value / Content"v=spf1 include:_spf.example.net ~all"The text itself. Some panels add the quote marks for you.
TTL3600How many seconds resolvers may cache the answer before asking again.

In raw zone file form the same TXT record looks like this: example.co.za. 3600 IN TXT "v=spf1 include:_spf.example.net ~all". You rarely need to type that format, but it helps when a support article or a lookup tool shows records that way.

Common TXT record examples you will see

Almost every TXT record you add will fall into one of the groups below. Each one sits at a specific name, so getting the host field right matters as much as the value.

PurposeHost / nameExample value (shortened)
SPF (who may send your mail)@v=spf1 include:mail.example.net ~all
DKIM (email signing key)selector._domainkeyv=DKIM1; k=rsa; p=MIIBIjANBgkq...
DMARC (policy and reports)_dmarcv=DMARC1; p=none; rua=mailto:dmarc@example.co.za
Google site verification@google-site-verification=AbC123...
Microsoft 365 verification@MS=ms12345678
Other service checks@ or a given labelA token supplied by the service, such as a payment or social platform

Email records cause the most trouble, because a missing or broken SPF, DKIM or DMARC entry is one of the main reasons messages land in junk folders. Our guide on what a DNS SPF record is goes deeper on SPF syntax, and if your mail is already being filtered, read why business emails go to spam.

One SPF record only. You may have many TXT records at the root of your domain, but only one of them may start with v=spf1. Two SPF records make the check fail. If a new mail service asks you to add SPF, merge its include into your existing record instead of adding a second one.

How to add a TXT record to your domain

The steps are much the same whichever panel you use. Below we use Plesk, the control panel on our hosting plans, with notes for registrar DNS editors.

  1. Find out where your DNS is hosted. TXT records must go where your domain's nameservers point. If your nameservers point to your web host, edit DNS there. If they point to your registrar, edit DNS at the registrar.
  2. Open the DNS editor. In Plesk, go to Websites & Domains, choose the domain, then open Hosting & DNS and DNS Settings. In a registrar panel, look for "Manage DNS" or "DNS records".
  3. Add a new record and choose TXT. Click Add Record and set the type to TXT.
  4. Enter the host. Leave it blank or use @ for the root domain. For DMARC enter _dmarc, and for DKIM enter the full selector label you were given.
  5. Paste the value exactly. Copy the text from the service without extra spaces or line breaks. Leave TTL at the default unless told otherwise.
  6. Save and apply. Plesk asks you to apply DNS changes. Then wait a few minutes before you click "Verify" in the service that asked for the record.

New records often show within minutes, but resolvers that cached an older answer can take up to the TTL to update. Our explainer on DNS propagation covers why some people see changes before others. Moving a domain to a new registrar at the same time? Copy all TXT records across before you start a domain transfer, so email checks keep passing.

TXT record lookup: how to check what is published

Before you call a service and say "the record is there", check what the world actually sees. You can run a TXT record lookup in three ways.

Command line

On Mac or Linux run dig TXT example.co.za +short. On Windows run nslookup -type=txt example.co.za. For DMARC, query _dmarc.example.co.za instead.

Online checker

Any free DNS lookup site will show TXT records for a name. Pick one that queries several resolvers so you can spot caching differences.

Your nameserver directly. The third way, and the one to use if the lookup returns nothing, is to query your authoritative nameserver with dig TXT example.co.za @ns1.yourhost.co.za. If the record shows there but not on public resolvers, it is a caching delay. If it does not show there either, the record was added in the wrong place.

DNS TXT record length limit and other rules

Most searches about TXT records ask about size. Here are the limits that actually matter in practice.

  • 255 characters per string. A single string inside a TXT record cannot exceed 255 characters. Longer values, such as 2048-bit DKIM keys, are split into several quoted strings that the reader joins together. Many panels, including Plesk, split them for you.
  • Total size. A TXT record can hold several strings, but very large answers are slower and can fail over some networks. Keep each record as short as the service allows.
  • SPF has a 10-lookup limit. Each include, a, mx or redirect in an SPF record costs a DNS lookup, and more than ten makes SPF fail.
  • Plain text only. Use straight quote marks, not curly ones pasted from a word processor, and no hidden line breaks.
  • Several TXT records per name are fine. Verification tokens, SPF and other entries can sit side by side at the root.

Troubleshooting a TXT record that will not verify

SymptomLikely causeFix
Lookup shows nothingRecord added at a DNS host your nameservers do not useCheck your nameservers, then add the record in the right panel
Record shows as _dmarc.example.co.za.example.co.zaPanel appended the domain to a full name you typedEnter only _dmarc in the host field
Verification says "token not found"Extra space, missing character or old cached answerRecopy the value, lower the TTL, wait and retry
SPF "permerror"Two SPF records or more than ten lookupsMerge into one v=spf1 record and trim includes
DKIM fails after adding keyKey broken across lines or truncatedPaste the key as one value and let the panel split it

If you are still stuck, our team can check the zone for you. Domains registered with us, including every .co.za domain name, come with free DNS management, so adding or fixing a TXT record is part of the normal service rather than a paid extra.

When you will need to add a TXT record

Most business owners only meet TXT records at a few moments: setting up new email, connecting Google Search Console, moving to Microsoft 365 or Google Workspace, or adding a marketing platform that sends mail on your behalf. Keep a simple list of every TXT record you add and why. When you change mail provider or tidy up DNS later, that list stops you deleting a record that something still depends on.

If you would rather not touch DNS at all, send our team the values you were given through the contact page and we will add them for you.

DNS TXT record: FAQs

What is a DNS TXT record used for?

A DNS TXT record publishes text against a domain so other systems can read it. The two main uses are proving domain ownership to services such as Google Search Console and Microsoft 365, and publishing email security policies like SPF, DKIM and DMARC. DNS does not act on the text itself; the service that reads it decides what it means.

Get a domain with DNS you can manage yourself

Every domain registered with Allanux Web includes free DNS management, so you can add TXT, MX and A records in minutes, and our team is on hand if a verification will not pass. A .co.za domain starts at R109 a year.

Search for your domain See domain prices