TXT record


A TXT record is a type of resource record in the Domain name systemically used to provide the ability to associate arbitrary text with a host or other name, such as human readable information about a server, network, data center, or other accounting information.
It is also often used in a more structured fashion to record small amounts of machine-readable data into the DNS.

Background

A domain may have multiple TXT records associated with it, provided the DNS server implementation supports this. Each record can in turn have one or more character strings. Traditionally these text fields were used for a variety of non-standardised uses, such as a full company or organisation name, or the address of a host.
In 1993 RFC 1464 proposed a simple approach to storing attributes and their values in these text fields. This is now used extensively in:
As unstructured text, organisations can use the TXT string in any way they define, for example:

example.com. IN TXT "This domain name is reserved for use in documentation"

RFC 1464 defines a structured format that can be used to define attributes and their values in a single record, as in these examples:

host.widgets.com. IN TXT "printer=lpr5"
sam.widgets.com. IN TXT "favorite drink=orange juice"

In practice, services using TXT records often do not follow this RFC, but instead have their own specific format.

Example usage

The character string from a TXT record used for SPF:
"v=spf1 ip4:192.0.2.0/24 ip4:198.51.100.123 ip6:2620:0:860::/46 a -all"
An example of use for DMARC:
"v=DMARC1;p=none;sp=quarantine;pct=100;rua=mailto:dmarcreports@example.com;"
Use for site verification:
"google-site-verification=6P08Ow5E-8Q0m6vQ7FMAqAYIDprkVV8fUf_7hZ4Qvc8"
Use for custom email service:
_amazonses.example.com. IN TXT "pmBGN/7MjnfhTKUZ06Enqq1PeGUaOkw8lGhcfwefcHU="