Home   /  blog   /  What is a TXT Record in DNS? Uses, Purpose & Security Role

What is a TXT Record in DNS? Uses, Purpose & Security Role

What is a TXT Record in DNS? Uses, Purpose & Security Role
  • 02 July 2025

DNS does more than just translate domain names into IP addresses. It has various records that power security, verification, and service configurations across the internet. One such record is TXT, which is usually used for domain validation and email spam protection. In this blog post, you will learn what a TXT record in DNS is and its role. 

What are DNS TXT Records?

TXT Records - These are the type of DNS records that store information about a domain in text format. It gives domain administrators the capacity to connect the text with a DNS zone, among other things.

Other types of DNS records are often readable only in computer-readable languages. However, TXT records can hold both human-readable and machine-readable data. 

TXT records in DNS are limited to 255 characters per string. That’s why it is common for a single domain to have multiple TXT records (due to the short character limit).

Format of TXT Records in DNS

Regarding the format structure, TXT records in DNS involve the following components:

  • Name (Host): The domain or subdomain to which a record is tied. For example, “@”, “mail”, or “_dmarc.domain.com”.
  • TTL (Time to Live): How long (number of seconds) DNS resolvers will cache the record. 
  • Record Type: TXT (always)
  • Record Value: The text (value) you want to add and associate with the domain. 

DNS TXT Record Format Table

For your understanding, we have added an example TXT record format table below. The description column on the far right has been added for your information only, so you can better understand the purpose. It is not part of the format. 

Host Name

Type

TTL 

Value

Description

@

TXT

3600

"v=spf1 ip4:192.0.2.0/24 include:example.com -all"

SPF record to define allowed email senders

_dmarc

TXT

3600

"v=DMARC1; p=reject; rua=mailto:[email protected]"

DMARC policy to enforce email authentication

_domainkey.mail

TXT

3600

"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr..."

DKIM public key for email signing

_google-site-verification

TXT

3600

"JH8hDs7JF-HXyz123456789"

Google Search Console domain ownership verification

@

TXT

3600

"facebook-domain-verification=abcdef123456789"

Facebook domain verification

@

TXT

300

"Some internal notes or metadata for domain management"

General text record (informational)

_acme-challenge

TXT

300

"zYX9ex_3pKlsA1qzEZRBN37wYxW6x0uFiG3L9cM43r8"

SSL/TLS certificate domain verification

Note: Some DNS providers automatically append the domain name, so entering _dmarc in the Host field creates _dmarc.example.com.

But if you're manually editing a BIND zone file, you'd typically write the FQDN (fully qualified domain name). 

Primary Uses of DNS TXT Records

The TXT records were initially intended to add human-readable and machine-readable notes. Nowadays, they are used for various other purposes such as:

  • Domain ownership verification
  • Email security (spam prevention)
  • Website ownership verification
  • Implementing Sender Policy Framework (SPF)
  • SSL certification validation
  • Domain-based message authentication

How do TXT Records Help with Email Security?

Cybercriminals often forge or create fake domains. They send email messages for phishing or other crimes using these counterfeit domains. That is where TXT records come into play. They help the email server authenticate and determine if the message comes from a trusted source. 

Some of the commonly used authentication methods by TXT records include:

Domain Keys Identified Mail (DKIM) Records

In DKIM, every single email is digitally signed using a public-private key. The public key is hosted in TXT records associated with a particular domain name. Recipients use this key to check if the email is from the correct sender and whether it has been tampered with during transit. In this way, DKIM ensures email security.

Sender Policy Framework (SPF) Records

Various servers are involved in sending emails on behalf of a domain name. SPF records include a list of servers authorized to send emails via a domain. This helps prevent email spoofing and, by extension, spam.

How do TXT Records Help with Domain Ownership Verification?

Some webmaster tools use the TXT records to verify domain ownership. One can confirm that they hold the administrative power by uploading a TXT record provided by Webmaster Tools into your DNS records. 

How to Perform a TXT Record Lookup?

TXT record lookup is the process by which one can retrieve TXT records associated with the DNS of a particular domain. There are various ways you can do that; two common ones include:

  • Using an Online TXT Record Lookup Tool
  • Using the Command Line Prompt/Terminal

Let us introduce you to both methods one by one.

Using the Online TXT Record Lookup Tool

Whatsmydns.me offers you a free tool that lets you perform a TXT record lookup quickly and for free. Here’s how you can do it:

  • Enter URL
  • Choose the DNS server (Google, Yandex, Quad9, Cloudflare, etc).
  • Hit the “TXT Lookup” button

That’s it. Upon following the above steps, the tool will provide you with the results as shown below. 

Using the Command Line Prompt/Terminal

TXT record lookup can also be performed using the command line prompt/terminal. However, the procedure can vary depending on the operating system installed on your device. For your ease, we have shared the step-by-step procedure to perform a TXT record lookup on Windows and MAC. 

Steps to Perform TXT Lookup on Windows

To perform a TXT lookup on Windows using the command line prompt, do the following:

  • Open the “Run” menu in the system settings (“win+R” is the shortcut key).
  • Type “cmd” and press the “Enter” button. 
  • Next, type “nslookup -q=txt example.com” and press “Enter”. Don’t forget to replace the “example” with your desired domain name. 

Following the above steps, you will get the output like the one we shared below as an example. 

Everything under the “Non-authoritative Answer” will be the TXT records associated with the DNS of the provided domain. 

Steps to Perform TXT Lookup on MAC/Linux

To perform the TXT record lookup on MAC, do the following:

  • Open the command terminal (“Command + Space” is the shortcut key for Mac, for Linux it is “CTRL+ALT+T”)
  • In the terminal, type the command “dig example.com TXT”. (Replace example with your desired domain name)
  • Press the Enter button to run the command. 

After implementing the above steps, you will get the result shown in the example image we shared below. 

All entries under the “Answer Section” are the TXT records associated with the DNS of the provided domain. 

How to Add TXT Records with Popular Domain Management Tools?

If you manage domains or plan to do so in the future, you might come across adding TXT records to your DNS settings. The process of adding these records varies with the domain provider. Below we have shared the process for some famous domain and hosting service providers. 

Adding TXT Records in Hostinger

To add TXT records in Hostinger, do the following:

  • Log in to your Hostinger account. 
  • Navigate to domains. You can find the “Domain” tab both in the menu bar and the left-side bar. 
  • Click on “Manage” on the right side of the relevant domain. 
  • Click on the DNS/Nameservers tab in the left-side bar. This will open your DNS records table. 
  • Click “Type” and choose “TXT” from the drop-down list. 
  • Type the information, i.e.,  Name, Value, and TTL (it can also be left to the default value), and click the add record button. 

This is how you can add TXT records in the DNS of the Hostinger dashboard. 

Adding TXT Records in Bluehost

To add TXT records in the DNS of a Bluehost account, you will need to take the following steps:

  • Log in to your Bluehost account. 
  • From the dashboard, navigate to “Websites” in the left-side bar. 
  • Click on the “Settings” button at the bottom of your desired domain name. 
  • Click on the “Domains” button. This will open your domain's settings. 
  • Click on the “three dots” next to your domain name and open “Advanced DNS Editor”. 
  • Under the “Zone Editor,” click the “Add Record” button. 
  • Choose “Add TXT Record” from the dropdown list, add your values, and click the “Save All Records” button. 

That is how you add a TXT record in the DNS of a domain registered with Bluehost. 

Adding TXT Records in GoDaddy

Below are the steps for adding TXT records in the DNS of a domain registered with GoDaddy. 

  • Log in to your GoDaddy dashboard. 
  • Scroll down and navigate to the “Domains” section. 
  • Inside the domain section, click the “Manage” button on the right side of your desired domain. 
  • Click “DNS” in the left-side bar. 
  • Click “Add New Record”. 
  • Under “Type,” click “Choose an Option” and select “TXT” from the list. 
  • Add Name, Value, and TTL, and click the “Save” button. 

Your new TXT record will be added to the DNS records list.  

Wrapping Up

So, there you have it, what a DNS record is and for what purpose it is used. To add one to your DNS records, follow the steps we have shared for some of the popular hosting services above. To learn more about DNS records, visit our blog section. 

Related Blogs

What is Global Network and Why it Matters for Your DNS?
What is Global Network and Why it Matters for Your DNS?

What is Global Network and Why it Matters for Your DNS?

  • 09 Jul 2025
Read More
Bandwidth Vs Speed - A Complete Guide to Understand the Difference
Bandwidth Vs Speed - A Complete Guide to Understand the Difference

Learn how bandwidth and speed differ, how they impact your internet performance, and why both matter for your connection

  • 02 Jul 2025
Read More
What is DNS Propagation, And Why is It A Lengthy Process?
What is DNS Propagation, And Why is It A Lengthy Process?

DNS Propagation: Why Changing Your DNS Takes Time (And What to Expect)

  • 04 Mar 2025
Read More
[[above-footer-ad]]
[[sidebar_ad]]