What Is TXT Record in DNS & How It Works

Guide to What Is TXT Record in DNS for Newbies

TXT is a type of DNS record in a form of text that contains miscellaneous information for sources outside your domain. It helps store domain information, improve email security, and more. There are several types of DNS records, and TXT is one of the most common ones. In this article, we will discuss how to set up a TXT record, benefits, types, and troubleshooting issues.

Selecting a domain hosting provider is essential for optimizing site performance and securing your online presence. Explore our comprehensive list of top domain hosting providers to make an informed choice.

 

Recommended Domain Hosting Providers

ProviderUser RatingBest ForExpert & User Reviews
5.0VersatilityHostArmada ReviewVisit HostArmada
4.9CustomizationUltahost ReviewVisit Ultahost
4.6SpeedHostinger ReviewVisit Hostinger

Takeaways
  • A TXT record is a type of DNS record that provides additional information about a domain
  • TXT records are typically used to verify domain ownership, authenticate email senders, and provide other types of information
  • To set up a TXT record, log in to your DNS provider’s control panel and add a new TXT record
  • Different types of TXT records, including SPF, DKIM, and DMARC, are used for email authentication
  • TXT records can improve your domain’s security and help prevent spam and phishing attacks

 

What Is A TXT Record in DNS?

TXT is a type of DNS record containing miscellaneous information for sources outside your domain. A domain may have several TXT records, and you can store any information within a record.

They are stored in TXT (text) format and are easily readable by humans and machines to retrieve information about the domain. DNS TXT records serve a variety of purposes:

  • Allows you to store any type of information, for example, the location of the web server, email address of the webmaster
  • Enables third-party services to verify domain ownership
  • Validate email sources by ensuring users’ email is sent from a compliant list of IP addresses, preventing email spoofing and spam attacks

What Is the Format of a TXT Record?

The TXT record uses a key-value format consisting of the attribute name and value to store any new information on the domain:

<name> IN TXT ‘’value’’ example.com. IN TXT “host=advice334”

The value can be any combination of printable ASCII characters, which allows you to be flexible when storing information. Also, it’s possible to include multiple values within a single TXT record.

Host nameRecord TypeValueTTL
Host AdviceTXT“Favorite gadget=macbook”1005

Importance of TXT Record for Domain Owners

TXT records are essential to domain owners, not just because they’re a part of the DNS record system, but because they also serve critical functions related to your website’s security, performance, and usability. Here’s how:

Verification of Domain Ownership

Many third-party services, like SSL certificate providers, domain registrars, and email services, may require domain owners or administrators to verify domain ownership before accessing certain features. TXT record provides a simple but powerful way of verifying domain ownership without tampering with the DNS.

Usually, the third-party service generates a unique TXT code with a verification string, which you add to your website’s root directory. The verification code may look like this:

Name: @ or blank, depending on your DNS’s provider requirements

Record Type: TXT

Value: “example-site-verification=35LhR11sr4Lg10vPT4CRT0921opo5dRbYq7TuWzBRYQh”

TTL: 5560

Email Authentication

TXT records act as an email authenticator and help prevent email spoofing and improve email deliverability. If configured for this purpose, it will contain all the IP addresses authorized to send emails to a specific domain.

They also play an essential role in implementing email authentication protocols like DomainKeys Identified Mail (DKIM), Sender Policy Framework records (SPF), Domain-Based Message Authentication, Reporting & Conformance records (DMARC).

Information Dissemination

The primary purpose of TXT records is to store domain information. They contain arbitrary texts that make them flexible when storing data. You can use them to provide additional information about your company, such as email addresses, social profiles, or even contact instructions. Since they’re publicly accessible, users can easily dig up information about your company when needed.

SEO Optimization

TXT records can also help optimize your website for higher visibility on search engines. Google Search Console, for instance, provides insightful analytics on your website performance. By linking your website to the search console, you can track your website traffic, sources, and other information needed for SEO optimization.

All you need to do is add the ‘google-site-verification’ string as a TXT record in your DNS. Another method is generating a unique verification code from the GSC. 

How to Set Up a TXT Record in Your DNS

Setting up a TXT record in your DNS is a pretty straightforward process. To do this, follow these steps:

  • Log into your DNS provider’s control panel or dashboard
  • Locate the section for managing DNS records or zones. This may vary depending on your DNS provider
  • Then, click on the ‘Add New’ button
  • You’d be prompted to add the type of the record, hostname, value, and TTL (time to last)
  • For the host, add an @ corresponding to the domain or subdomain you’re creating the record for. Some providers may require that you leave this field blank
  • Click on the ‘Save’ button
Tip
Tip: It takes about 30 minutes to several hours for the newly created records to take effect, depending on your DNS provider and TTL value.

Read more on how to create a TXT record.

Benefits of Adding TXT Records to Your DNS

Adding TXT records in your DNS secures your domain from spamming and phishing attacks. Here are other benefits:

Enhanced Security

Spoofing is a common tactic cybercriminals use to commit fraud. They do this in different ways, for instance, by sending emails with fake domain names that appear legitimate or creating fake websites. One way to prevent this is by adding TXT records in your DNS.

Implementing email authentication protocols such as SPF, DKIM, and DMARC using TXT records helps to prevent email spoofing and other attacks that may compromise your website’s security. Email providers like Gmail and Microsoft use this method to ensure recipients trust emails from your website domain. It also helps to maintain the integrity of your communication system.

Improved Email Deliverability

The email authentication protocols highlighted in the preceding step can also improve email deliverability and ensure your emails reach the intended recipients. Implementing these authentication techniques through TXT records reduces the likelihood of your emails being marked as spam, establishing your domain’s authenticity.

The DMARC record, for example, authenticates emails that bypass the SPF or DKIM record checks. It acts as an extra layer of security against cyber crimes and ensures your email is delivered to the appropriate parties.

Lastly…

Verification of Domain Ownership

Many third-party services, such as search engines and email providers, require a form of validation before granting access to certain features. This ensures that only authorized people can access and manage your website.

For example, most websites are protected by SSL certificates. Certificate authorities or SSL providers require domain validation to prevent random individuals from obtaining SSL certificates for your domain. So they generate a unique verification code that is added to your TXT record in the DNS domain you want to secure. Once done, the SSL certificate provider can verify domain ownership and issue the certificate accordingly.

Common Uses for TXT Records in DNS

Peter Lowe said in his contribution with RIPE Labs that ‘TXT records are perhaps the most flexible type of DNS record available.’ I believe he’s right. Because of their flexibility, you can use them to store details about a framework, for example, RFC 7208. Listed below are some other use cases:

Domain Ownership Verification

Domain ownership verification is the commonest use of TXT records. As I shared earlier, they’re mainly used by search engines and email providers to authenticate domain names before granting access to specific features.

A popular use case is websites using Google services. Google Analytics is a popular SEO tool for checking and analyzing website traffic. This includes your overall site health, referring domains, high-traffic sources, and more. Before accessing this data, you must verify that you own the domain. Although there are many ways to verify your domain on GA, using TXT records remains one of the easiest and most secure options.

Network and Service Management

TXT records can also come in handy in configuring network and service management apps. These applications often require certain information for configuration. TXT records can store and seamlessly retrieve this data when needed. For example, most CDN providers require adding a TXT record containing authentication details before configuring correctly.

  • TXT records can also be used to specify configuration information for SIP (Session Initiation Protocol) phones within the DNS
  • SIP is a signaling protocol used in VoIP (Voice-over Internet Protocol) communications to connect, modify, and terminate multimedia sessions
  • By utilizing TXT records, VoIP service providers can store SIP phone configuration details directly in the DNS zone of the domain

HostArmada: The Best Domain Hosting
HostArmada offers a wide range of Domain TLDs at affordable prices that come with DNS management and email forwarding. They offer a free domain forever as part of all their hosting plans. HostArmada is an excellent solution for anyone looking for a reliable domain registrar and the convenience of managing websites and domains from a single place.
Visit HostArmada

Types of Text Records and How They Can Be Used

There are several types of TXT records available, and there are no limits to how they’re used. As one of the most flexible types of DNS records, here are some common ways to use them to enhance the security of your domain:

SPF (Sender Policy Framework)

SPF is a complaint email authentication protocol used to maintain a list of IP addresses authorized to send emails on behalf of your domain.

  • When a mail server receives an email, it checks to see if the IP address on the email matches that from the SPF record
  • If it doesn’t, the email fails the SPF authentication and is marked as SPAM or rejected

SPF also allocates authority to third-party email vendors such as Microsoft Office 365, Mailchimp, etc. It prevents email spoofing by validating that the server carrying out the sending request is validated to send emails on behalf of the domain. This prevents fraudsters from sending emails with your domain name.

Example

For example, the SPF record “v=spf1 a mx include:_spf.google.com ~all” indicates that the IP addresses of the domain A and MX records can send emails on behalf of the domain, including Google email servers. The ‘all’ command at the end of the string specifies that the server should mark the email as SPAM if the receiving mail doesn’t match the set standards.

DKIM (DomainKeys Identified Mail)

DKIM is another email authentication protocol to prevent spoofing and phishing. It has a digital signature mechanism that signs outgoing emails from a domain with a private and public key. This process guarantees that the message in the email hasn’t been tampered with. Here’s how.

  • When you send an email, your server creates a DKIM signature with the private key
  • The receiving server then runs a DNS query to your server to retrieve the public key
  • If the public key doesn’t match the receiving server’s, the email is marked as spam or rejected

Example

Consider this DKIM signature: “v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdKEiJFddB+UXtNkfe23v/DJQzMG”

The public key is the p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdKEiJFddB+UXtNkfe23v/DJQzMG” string that is stored as a TXT record on the DNS record of your server. Once the outbound mail gets to the receiving end, it retrieves this value to verify the signature’s authenticity.

DMARC (Domain-based Message Authentication, Reporting, and Conformance)

DMARC is like an extra layer of security used to validate emails that bypass the SPF and DKIM protocols. Bruno Mirchevski, hosting expert at HostAdvice, explains it better: DMARC builds on SPF and DKIM by publishing policies telling email receivers how to handle authentication failures, providing reporting to domain owners. The policy can be set in three ways:

  • None (meaning do nothing)
  • Quarantine emails
  • Reject emails

…when the outgoing email fails SPF and DKIM authentication. These policies are stored as a DNS TXT record.

You can also create compliance reports inside DMARC that triggers your email when it fails SPF and DKIM authentication protocols. This way, you can easily monitor who is trying to spoof your email address.

Example

This is an example of a DMARC record:

"v=DMARC1; p=none; rua=mailto:postmaster@example.com; ruf=mailto:abuse@example.com; adkim=s; aspf=s;"

The v=DMARC1 indicates the version of DMARC being used, Version 1. p=none means the DMARC policy is set to none. ruf=mailto:abuse@example.com and ruf=mailto:abuse@example.com are the emails that receive aggregate and forensic reports about the email authenticity. adkim=s and aspf=s set the alignment mode for DKIM and SPF protocols, respectively.

Google Site Verification

As I shared earlier, most Google services, like Search Console, Ads, and Analytics, require verifying your domain ownership before syncing your website on the platform. By verifying your domain, you grant Google access to crawl your web pages and equally confirm that you are the owner or administrator of your site.

Example:

The string: “google-site-verification=abc123def456” is used for Google site verification. All you need to do is store the record in TXT format on your DNS zone. Each code is unique to each website, so visit the Google service platform to generate your domain code.

Learn more on how to verify domain ownership on Google.

Information Dissemination

TXT records can be used to provide important information to outside sources about your domain, such as email addresses or other contact details. This is very important for users who want to know about your company’s business offerings.

Example:

The TXT record “v=spf1 a mx include:_spf.example.com ~all; contact=admin@example.com” combines SPF and contact information:

  • v=spf1 indicates the version of SPF used (version 1)
  • ‘a mx’ means domain A and MX’s records can send emails
  • ‘contact=admin@example.com’ is the administrator email

Service Discovery

While TXT records are helpful for several purposes, they can also be used to streamline the process of locating and accessing network services, therefore, eliminating the need for manual configuration. For instance, a file server may have a TXT record comprising its name, access protocols, and available shared folders.

Example:

This string, “printer=model1;” is a TXT record specifying the location (room 101) of a printer (model 1)

Read more about HostArmada

Expert and User Insights by HostArmada Customers
Top-rated
5.0
Based on 749 user reviews
  • User Friendly
    5.0
  • Support
    5.0
  • Features
    5.0
  • Reliability
    5.0
  • Pricing
    4.9
Visit Site

Troubleshooting Issues With Setting Up a TXT Record

Here’s how you can troubleshoot issues when setting up a TXT record:

Verify the Syntax

The syntax of a TXT record is the format structure used to store information in its TEXT-DATA field. It usually consists of the attribute followed by the value of the attribute. Both the value and the attribute are separated by an equal sign (=) and enclosed within double quotation marks (“”). The records should not exceed the 255-character limit as denied in the DNS protocol.

The TXT records shouldn’t have line breaks or multiple lines. You can separate multiple values using white spaces if you want to include multiple values in the record. In general, a standard TXT record syntax is as follows:

<owner> <class> <ttl> TXT "<attribute name>=<attribute value>"

A typical example of an SPF record:

"v=spf1 include:_spf.example.com ~all"

Check for Typos

One common mistake common to newbies is missing errors when typing or pasting a TXT syntax. Most times, these errors are almost unnoticeable. But even a small typo can cause data inconsistency and record failure. Plus, debugging these errors may require technical assistance from your DNS provider.

To avoid these mistakes,

  • Always cross-check the accuracy of your TXT record
  • Check out for errors in the syntax and other characters included
  • Refer to the documentation or guidelines provided by the third-party service to know what the specific format, content, and placement are
Tip
Pro tip: I recommend copying the required TXT format directly from the source or documentation and pasting it into the DNS zone. This mitigates errors caused by manual typing.

Verify the DNS Propagation

DNS propagation is the time it takes for the DNS changes to take effect on various DNS servers on the internet. After creating a TXT record, it may take several minutes to hours to propagate. This delay may result from DNS information cached at the servers at different levels. Other factors determining the timeframe are the TTL values of your DNS records, your internet service provider, or your domain registry.

That said, monitor all the changes to ensure they’re entirely propagated. Use DNS tools like DNS checker to validate that the new records have propagated to all the DNS servers.

Check for Conflicting Records

If all the preceding options don’t work, check your records for multiple entries, as this can cause conflicting issues, for example, failed verifications or email delivery issues. Ensure that no two records are the same. If you want to modify a record, simply delete the old record and replace it with the new one.

Check Your Domain Settings

Thoroughly access your domain settings and ensure all information entered is correct – domain name, TTK value, and your DNS provider. This is vital as domain settings can directly impact the functionality of your domain. For the best practices:

  • Verify that your domain name is spelled correctly and is appropriately registered
  • Always check the specified TTL value in your DNS settings before making an entry
  • Opt for a reputable and reliable DNS provider

Contact Your DNS Provider

If you’re still experiencing issues after trying out the steps outlined above and still experiencing issues, contact your DNS provider for further assistance. Most of these providers have different levels of support – email, live chat, phone support, ticket system, and a vast knowledge base of how-to articles.

Learn more on how to troubleshoot tag names in DNS TXT records.

Conclusion

There you have it! TXT records may seem small, but the potentials are unmatched. TXT Records offers a versatile solution for strengthening our online presence, from improving email deliverability to providing a secure means to sync domains with third-party apps. Remember to stay on par with recent updates from your provider and the third-party providers you use as well.

Ultahost Domain Hosting
UltaHost delivers customized hosting solutions for everyone, from beginners to industry giants, emphasizing superior VPS and managed hosting services for hassle-free website functionality. Ultahost offers a free domain, SSL, and many great features, but what really makes it stand out are its highly transparent pricing plans and all the included freebies.
Visit Ultahost

Next Steps

  • Learn what is Domain Name
  • Opt for hosting providers with secure DNS
  • Learn how to use DNS tools for web hosting
  • How to manage your DNS for web hosting
  • Implement the right strategies to speed up your site

Further Reading

Frequently Asked Questions

How do I create a TXT record in DNS?

To create a TXT record in DNS, follow these steps:

  • First, log into your DNS provider control panel
  • Locate DNS in the ‘Advanced Settings’ section (although this may vary depending on your provider)
  • Select ‘Add New Record’
  • Click ‘TXT’ in the type and enter your details
  • Lastly, click ‘Save’
What are some common uses for TXT records?

TXT records can be used for email authentication (SPF, DMARC, DKIM), verifying domain ownership, storing data in TXT records, and preventing SPAM attacks.

How can I troubleshoot issues with my TXT record?

If you are experiencing issues with your TXT record, listed below are some tips that may help:

  • Cross-check your TXT syntax for typos or misplaced characters
  • DNS propagation may delay your
  • Check out your TXT records for multiple entries of the same syntax
  • If the issue persists, contact your DNS provider
Are there any security considerations when creating a TXT record?

Yes, TXT records are case-sensitive, and you need to be security conscious when creating or updating records on your DNS. Also, they are flexible and can be easily exploited by cyber attackers to direct traffic away from your site or steal important information.

When creating a TXT record, ensure you enable two-factor authentication methods to protect your data, use data encryption tools and constantly review your records.

What is TXT and MX record?

TXT and MX records are types of DNS records. TXT record is used to store text-based information for sources outside the domain. It helps keep information for external servers and services, authenticating email requests and validating domain ownership. MX records, however, are used to direct emails to the correct email server.

What does TXT record stand for?

TXT record stands for ‘TEXT’ record and provides human-readable information about a server.

HostAdvice Speaks to ScalaHosting: An Interview with Chris Rusev

HostAdvice had the opportunity to speak with Chris Rusev, the CEO and co-founder of , a web hosting company that offers shared, cloud VPS, and res…
8 min read
Eddie Segal
Eddie Segal
Digital Marketing Specialist

Email Deliverability: What Is It, Key Factors & Best Practices

What is Email Deliverability? Think of it like mailing a letter and making sure it lands right in the recipient’s hands, not lost or thrown…
17 min read
Ela Gal-Kfir
Ela Gal-Kfir
Digital Marketing Specialist

Email Marketing vs. Social Media: Which is More Effective?

What is Email Marketing? Email marketing is a  that involves companies reaching out to potential and existing customers via email&nbsp…;
10 min read
Ela Gal-Kfir
Ela Gal-Kfir
Digital Marketing Specialist

Email Engagement Metrics, Calculation & Best Practices

Email engagement tells us how interested recipients are in the content of emails they receive. It provides insights into what types of em…
12 min read
Ela Gal-Kfir
Ela Gal-Kfir
Digital Marketing Specialist
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top