TXT record

From Wikipedia, the free encyclopedia
  (Redirected from TXT Record)
Jump to navigation Jump to search

A TXT record (short for text record) is a type of resource record in the Domain Name System (DNS) 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.[1]


A domain may have multiple TXT records associated with it, provided the DNS server implementation supports this.[2] Each record can in turn have one or more character strings.[3]

Common uses include verification of domain ownership; implementation of Sender Policy Framework,[4] DomainKeys, or DomainKeys Identified Mail records for verifying the sender of email messages;[5] and Zero-configuration networking DNS-based service discovery.[6][7]


To store new types of information, the experimental RFC 1464 suggests a structured format in TXT data fields. The format consists of the attribute name followed by the value of the attribute. The name and value are separated by an equals sign (=).[2]

The general syntax is:[2]

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


name  class   ttl    rr     text
joe    IN           TXT    "Located in a black hole=Likely to be eaten by a grue"
  1. Name: This is the host for the domain, which is actually a computer within the domain. The domain name is automatically appended to the host name. To make a record for the system www.example.com, the name value is just "www". If the name field is left blank, it will default to be the record for the base domain. The record for the base domain is called the root record or apex record.
  2. Value: This can be free form text data of any type. Each word is treated as a separate string unless one or more strings are enclosed in quotes. The maximum length of a string is 255 bytes, but any number of strings can be present in each record, subject to the standard DNS RDATA size limit of 65,535 bytes.[8]
  3. TTL: The TTL (Time to Live) is the amount of time, in seconds, the record will stay in cache on systems requesting your record (resolving nameservers, browsers, etc.).

Attribute name matching rules[edit]

The attribute name is considered case-insensitive.[2]

During lookups, TXT records that do not contain an unquoted "=" are ignored. TXT records that seem to contain a null attribute name, that is, the TXT-DATA starts with the character "=", are also ignored.[2]

Leading and trailing whitespace (spaces and tabs) in the attribute name are ignored unless they are quoted with a backtick (`).[2]

Note that most DNS server implementations require a backslash (\) or double quote (") in a text string to be quoted with a preceding backslash. The backtick (`) was chosen as a quoting character in this syntax to avoid confusion with backslash (\) (and remove the need for confusing strings that include sequences like "\\\\").[2]

Attribute values[edit]

All printable ASCII characters are permitted in the attribute value. No characters need to be quoted with a backtick (`). In other words, the first unquoted equals sign in the TXT record is the name/value delimiter. All subsequent characters are part of the value.[2]

See also[edit]


  1. ^ Rich Rosenbaum (May 1993). RFC 1464 Using the Domain Name System To Store Arbitrary String Attributes. IETF. doi:10.17487/RFC1464. RFC 1464. https://tools.ietf.org/html/rfc1464. Retrieved 2016-02-05. 
  2. ^ a b c d e f g h Rosenbaum, R. "Using the Domain Name System To Store Arbitrary String Attributes". Tools.ietf.org. Retrieved 14 October 2018.
  3. ^ P. Mockapetris (November 1987). "TXT RDATA format". Domain names - implementation and specification. IETF. sec. 3.3.14. doi:10.17487/RFC1035. RFC 1035. https://tools.ietf.org/html/rfc1035#section-3.3.14. 
  4. ^ Scott Kitterman (April 2014). "DNS Resource Records". Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1. IETF. sec. 3.1. doi:10.17487/RFC7208. RFC 7208. https://tools.ietf.org/html/rfc7208#section-3.1. Retrieved 2014-04-26. 
  5. ^ "About TXT records". Google Apps Administration. Google. Retrieved 2014-08-17.
  6. ^ S. Cheshire and M. Krochmal, Apple Inc. (February 2013). Multicast DNS. IETF. doi:10.17487/RFC6762. RFC 6762. https://tools.ietf.org/html/rfc6762. 
  7. ^ S. Cheshire and M. Krochmal, Apple Inc. (February 2013). DNS-Based Service Discovery. IETF. doi:10.17487/RFC6763. RFC 6763. https://tools.ietf.org/html/rfc6763. 
  8. ^ "Archived copy". Archived from the original on 2015-10-19. Retrieved 2017-02-17.