What is a DNS TXT record?

The DNS TXT records associate arbitrary information to hostnames, that do not fit into other DNS RR types. DNS TXT records are popularly used in domain ownership verification, where a string hash generated by the service provider is stored and retrieved using DNS TXT records.

Input required to set DNS TXT records

DNS TXT record requires three inputs:

  1. Name: This is the DNS name of a hostname. For example, the DNS name will be "www" for the hostname "www.example.com". DNS Name must follow the limits defined in RFC1035,
    i. DNS name can have up to 250 characters, and must start with a letter (a-z), end with a letter or a digit (0-9), and can have only letters, digits, and hyphen (-) as characters.
    ii. DNS name can be split into labels using the dot (.) character, to a maximum of 8 labels. Each label can have 63 characters or less.
  2. Data: For the DNS TXT record, data can be arbitrary text containing printable ASCII characters. As per RFC1464, key-value pairs of text delimited using equals (=) are recommended.
  3. TTL: TTL or Time To Live is the time-span limit (in seconds) for the DNS data on the Internet. DNS caching servers use this limit while saving the record temporarily for faster DNS resolution.

Usage scope for DNS TXT records

DNS TXT records can store arbitrary text associated with the hostname. However, DNS servers may limit the length of the text that can be stored using TXT, to avoid processing large chunks of information. To avoid congestion, it is recommended to use different hostnames for different information sets, thus functioning like databases.

How to host a DNS TXT record

DNS records are hosted on the Internet through DNS hosting services. If you are using SlickAlpha DNS, check this related guide to learn how to add a DNS record on your SlickAlpha account.

How to check DNS TXT records

DNS records can be queried directly on your system terminal using the dig command. To check your DNS TXT records on the browser, try our free DNS Lookup tool.

Uses of DNS TXT records

DNS TXT records are popularly used in domain ownership verification. DNS TXT records are also used in various email-related implementations such as Sender Policy Framework (SPF), DomainKeys Identified Mail (DKIM), and Domain-based Message Authentication, Reporting and Conformance (DMARC).