TXT record

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 some arbitrary and unformatted text with a host or other name, such as human readable information about a server, network, data center, and other accounting information.[1]

Usage

A domain is not limited to having only one text record. Any fully qualified domain can potentially have several records.[2] Each record can have one or more character strings.[3]

Common uses include defining to verify domain ownership or in setting up Sender Policy Framework,[4] DomainKeys, DomainKeys Identified Mail records which are used to validate legitimate email sources from a domain,[5] and Zero-configuration networking DNS-based service discovery.[6][7]

Format

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>"

Example:

name  ttl  class   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, with a maximum length of 255 characters. Each word is treated as a separate string unless one or more strings are enclosed in quotes.
  3. TTL: The TTL (Time to Live) is the amount of time the record will stay in cache on systems requesting your record (resolving nameservers, browsers, etc.). The TTL is set in seconds (e.g., 60 is one minute, 1800 is 30 minutes).

Systems which have a static IP address should usually have a TTL of 1800 or higher. Systems with a dynamic IP address should usually have a TTL of 1800 or less. The lower the TTL the more often a client will need to query the name servers for your host's (record's) IP address this will result in higher query traffic for your domain name. However, a very high TTL can cause downtime if you need to switch your IP addresses quickly.

Attribute name matching rules

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 "`").[2]

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

Attribute values

All printable ASCII characters are permitted in the attribute value. No characters need to be quoted with a "`". 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

References

This article is issued from Wikipedia - version of the 12/2/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.