Sep
17

TXT Record Explained: What Is a TXT Record and How Does DNS Verification Work

Learn what a TXT record is, how TXT records store text in DNS, and how they are used for domain verification, SPF, email security, and other DNS configurations.

TXT Record Explained: What Is a TXT Record and How Does DNS Verification Work?

A TXT record is a type of DNS record that allows a domain owner to publish text information in the DNS system.

TXT records are used for several purposes. They are commonly used for domain verification, email authentication, SPF policies, and other services that need to confirm control or publish information about a domain.

Unlike an A record or AAAA record, a TXT record does not normally tell a device which IP address to connect to. Instead, it stores text data that a service or system can look up and read.

In this guide, we will explain what a TXT record is, how it works, what TXT records are used for, and how to check them for any domain.

What Is a TXT Record?

A TXT record is a DNS record used to store text associated with a domain or hostname.

A simple TXT record can look like this:

example.com    TXT    "This is a TXT record"

The text stored in the record can contain information used by different systems.

For example, a website platform may ask you to add a unique verification value such as:

example.com    TXT    "service-verification=abc123xyz"

The service can then perform a DNS lookup and check whether the expected value exists.

How Does a TXT Record Work?

The basic process is straightforward.

  1. A service gives you a TXT value.
  2. You add that value to your domain's DNS zone.
  3. The DNS record becomes publicly available after the change is published.
  4. The service performs a DNS lookup.
  5. The service checks the TXT record for the expected value.

The process can be represented like this:

Domain
   ↓
DNS
   ↓
TXT Record
   ↓
Verification Value
   ↓
Service Confirms Domain

This is why TXT records are frequently used when a website or online service needs to verify control of a domain.

TXT Record Example

A basic TXT record may look like this:

Type:  TXT
Name:  @
Value: "verification=abc123"
TTL:   3600

Here:

  • Type is TXT.
  • Name identifies the hostname where the record is published.
  • Value contains the text data.
  • TTL controls DNS caching time.

The exact fields and interface can look different depending on your DNS provider.

Read More

If you are building a complete understanding of DNS records, start with these guides:

What Are TXT Records Used For?

TXT records can be used for different types of DNS-based information.

Common uses include:

  • Domain ownership verification
  • Email authentication
  • SPF information
  • Service configuration
  • Security-related DNS policies
  • Verification for third-party platforms

The exact format of the TXT value depends on the system that uses it.

TXT Records for Domain Verification

One of the most common uses of a TXT record is domain verification.

A service may ask you to prove that you control a domain before allowing you to use certain features.

Instead of asking you to change your website, the service can provide a unique TXT value.

For example:

Type:  TXT
Name:  @
Value: "verify=7f8c91examplevalue"

You add this record to your DNS settings. The service then looks up the TXT records for your domain.

If it finds the expected verification value, it can confirm that the DNS configuration contains the value it requested.

TXT Records and SPF

TXT records are also commonly associated with SPF.

SPF is an email authentication mechanism that allows a domain to publish information about which mail servers are authorized to send email for that domain.

An SPF policy can be published as a TXT record.

A simplified example could look like:

example.com    TXT    "v=spf1 include:mail.example.net ~all"

The exact SPF value depends on the email services used by the domain.

If you use an email provider, follow the provider's current SPF instructions rather than copying an SPF record from another domain.

TXT Record and Email Security

TXT records can play an important role in email security.

For example, SPF information is stored in DNS as TXT data. Other email security technologies can also use DNS records to publish information used during authentication.

However, different email security systems have different record formats and purposes.

For example:

  • SPF publishes information about authorized sending sources.
  • DKIM uses DNS to publish public-key information for email signatures.
  • DMARC publishes a policy that helps receiving systems handle authentication results.

These technologies should not be treated as interchangeable simply because DNS is involved.

TXT Record vs A Record

A TXT record and an A record have completely different purposes.

FeatureTXT RecordA RecordPurpose | Stores text information | Maps a hostname to IPv4
Value | Text data | IPv4 address
Example | "verification=abc123" | 192.0.2.10
Common use | Verification and policies | Website/server addressing

TXT Record vs MX Record

TXT and MX records are also different.

FeatureTXT RecordMX RecordMain purpose | Stores text information | Specifies mail servers
Typical value | Text string | Mail server hostname
Priority | No MX-style priority | Yes
Common use | Verification and email policies | Email delivery

For example, an MX record tells mail servers where email should be delivered. A TXT record can publish SPF information or a domain verification value.

Can a Domain Have Multiple TXT Records?

Yes. A domain can have multiple TXT records.

For example, a domain may publish TXT records for different services:

example.com    TXT    "verification=abc123"
example.com    TXT    "v=spf1 include:mail.example.net ~all"

Different TXT records can serve different purposes.

However, some specific TXT-based systems have their own rules about how values should be combined or published. Always follow the documentation of the service that supplied the record.

Where Do You Add a TXT Record?

You normally add a TXT record through the DNS management panel of the provider that hosts your DNS zone.

This may be your:

  • Domain registrar
  • DNS hosting provider
  • Web hosting provider
  • CDN or DNS platform

The correct place depends on which service is authoritative for your domain's DNS.

If you add a TXT record at a provider that is not authoritative for the domain, the public DNS result may not change.

How to Add a TXT Record

The exact interface varies between DNS providers, but the general process is similar.

  1. Open your DNS management panel.
  2. Find the DNS records section.
  3. Choose TXT as the record type.
  4. Enter the hostname or name provided by the service.
  5. Enter the TXT value exactly as provided.
  6. Save the DNS record.
  7. Wait for the record to become visible through DNS.
  8. Run a DNS lookup to verify it.

Be careful when copying long TXT values. A small change can cause a verification check to fail.

How to Check a TXT Record

You can check publicly available TXT records with a DNS lookup tool.

Use the AuraTools DNS Lookup tool and query the domain you want to inspect.

Look for records where the type is TXT.

A result might look similar to:

TXT    "verification=abc123"
TXT    "v=spf1 include:mail.example.net ~all"

You can then compare the published value with the value supplied by your verification or email provider.

Why Is My TXT Record Not Showing?

If you recently added a TXT record and cannot see it yet, several things may be responsible.

1. DNS Cache

DNS resolvers can cache records based on their TTL. A newly added record may not appear immediately everywhere.

2. Wrong DNS Provider

Your domain may use nameservers from a different DNS provider than the one where you added the record.

3. Incorrect Hostname

The record may have been added to the wrong hostname or DNS zone.

4. Typing Error

Verification values can be long. Check the TXT value carefully for missing or extra characters.

5. Incorrect Record Type

Make sure you selected TXT rather than another DNS record type.

TXT Record Troubleshooting Checklist

If a service cannot verify your domain, check the following:

  1. Confirm that you added the TXT record to the correct DNS provider.
  2. Check the hostname or record name.
  3. Check the complete TXT value.
  4. Make sure the record type is TXT.
  5. Check the public DNS result.
  6. Allow time for DNS caches to update.
  7. Retry verification after confirming the published record.

You can use AuraTools DNS Lookup to inspect the TXT records that are publicly visible for your domain.

TXT Records and Domain Verification

TXT-based verification is useful because it allows a service to check information published through the domain's DNS.

This can be useful when you want to connect a domain to a service without changing the website itself.

For example, a service may provide:

TXT
Name: @
Value: "service-verification=unique-token"

Once the record is publicly available, the service can query DNS and look for that token.

This is one reason TXT records appear frequently during website, analytics, email, cloud, and other service setups.

Are TXT Records Secure?

A TXT record is public DNS information. Anyone who can query the public DNS system may be able to see it.

For that reason, you should not place passwords, private keys, API secrets, or other confidential information inside a normal public TXT record.

When a service asks you to publish a TXT value, use the value supplied by that service and check its documentation if you are unsure what the value contains.

How Long Does a TXT Record Take to Update?

There is no universal fixed time for every DNS change.

The TTL and existing DNS caches can affect how quickly different DNS resolvers see the new TXT record.

If a verification service does not detect your TXT record immediately, first confirm that the record is correctly published and then allow time for DNS caching to update.

Frequently Asked Questions

What is a TXT record?

A TXT record is a DNS record used to publish text information for a domain or hostname.

What is a TXT record used for?

TXT records are commonly used for domain verification, SPF information, email-related configuration, and other services that need to publish text through DNS.

Can a domain have multiple TXT records?

Yes. A domain can have multiple TXT records for different purposes.

Can TXT records contain passwords?

You should not publish passwords or other confidential secrets in public DNS TXT records.

How do I check a TXT record?

You can use a DNS lookup tool and query the domain for TXT records.

Is SPF a TXT record?

SPF information is published in DNS using TXT records.

Why is my TXT record not visible?

Common reasons include DNS caching, an incorrect DNS provider, an incorrect hostname, or an error in the record value.

Final Takeaway

A TXT record allows a domain owner to publish text information through DNS. It is widely used for domain verification and email-related configuration.

When adding a TXT record, make sure you use the correct DNS provider, hostname, and value supplied by the service that requested it.

Because TXT records are publicly accessible DNS data, never use them to store passwords or private secrets.

Check TXT records with AuraTools DNS Lookup to see what TXT information is currently published for a domain.


Contact

Missing something?

Feel free to request missing tools or give some feedback using our contact form.

Contact Us