howtouselinux

Check DNS Txt Record with Dig Command in Linux

Table of Contents

 

TXT record also known as text record is a type of Domain Name System (DNS) record that contains text information for sources outside of their domain. It allows users to associate some text with a hostname.

  • Understanding DNS TXT Records
  • Purpose of DNS TXT records
  • Example of Txt record
  • Query DNS Txt Record with Dig command
  • Tip of DNS txt record

 

Understanding DNS TXT Record

The original RFC only indicates that ‘text strings’ go in the ‘value’ field of a TXT record. This could be any text that the domain owner wants to associate with their domain. The domain owner can add these txt records in the domain setting website.

Purpose of DNS TXT record

There are two important uses for DNS TXT records.

  • email spam-prevention This txt record will list all the servers that are authorized to send email messages from a domain. The email receiver can check if the send is legal or not by this.
  • domain ownership verification Domain owners can prove they control this domain by adding a specific TXT record.

 

Example of Txt record in Linux

Txt record is very similar to other DNS records. The record type is txt. This is one of TXT records for the domain google.com.

google.com. 0 IN TXT “google-site-verification=TV9-DBe4R80X4v0M4U_bd_J9cpOJM0nikft0jAgjmsQ”

Check DNS Txt Record with Dig command in Linux

The easiest way to check txt record in Linux is using dig command. Open the terminal and type dig domain txt. It will list the TXT record for this domain under answer section. By default, dig performs a lookup for an A record if no type argument is specified.

For example, dig google.com txt will return all the txt records for Google.com. From the answer section, we can see that there are 9 txt records for this domain google.com. The following are 2 of them.

;; ANSWER SECTION:
google.com. 0 IN TXT “docusign=1b0a6754-49b1-4db5-8540-d2c12664b289”
google.com. 0 IN TXT “google-site-verification=wD8N7i1JTNTkezJ49swvWW48f8_9xveREV4oB-0Hf5o”

Tip of DNS txt record

  • The TXT record was originally intended as a place for human-readable notes. Now it is also possible to put some machine-readable data into TXT records.
  • One domain can have many TXT records.

 

Check this post to learn more about DNS records.

Related:

2 Ways to Check DNS Speed

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Liquid Web Managed Word Press