Jump to content

TXT record

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Gilliam (talk | contribs) at 17:12, 7 September 2015 (Reverted edits by 117.238.210.249 (talk) to last version by 76.178.155.76). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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. A domain is not limited to having only one text record, any fully qualified domain may potentially have several records.

Common uses include defining to verify domain ownership or in setting up Sender Policy Framework,[1] DomainKeys, and DomainKeys Identified Mail records which are used to validate legitimate email sources from a domain.[2]

Format

To store new types of information, the TXT record uses a structured format in its TXT-DATA field. The format consists of the attribute name followed by the value of the attribute. The name and value are separated by an equals sign (=).

The general syntax is:

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

Example:

name  ttl  class   rr     text
joe        IN      TXT    "Located in a black hole"
  1. Name: This will be the host for your domain which is actually a computer within your domain. Your domain name is automatically appended to your name. If you are trying to make a record for the system www.example.com, then all you enter in the textbox for the name value is "www".
    Note: If you leave the name field blank it will default to be the record for your base domain. The record for your base domain is called the root record or apex record.
  2. Value: Free form text data of any type. May be no longer than 255 characters. Each word will be treated as a separate string unless one or more strings is enclosed in quotes.
  3. TTL: The TTL (Time to Live) is the amount of time your record will stay in cache on systems requesting your record (resolving nameservers, browsers, etc.). The TTL is set in seconds, so 60 is one minute, 1800 is 30 minutes, etc..

Systems that have a static IP should usually have a TTL of 1800 or higher. Systems that have a dynamic IP 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. Where as a very high TTL can cause downtime when you need to switch your IPs quickly.

Attribute Name Matching Rules

The attribute name is considered case-insensitive.

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.

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

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 "\\\\").

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.

See also

References

  1. ^ Scott Kitterman (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. Retrieved 26 April 2014. {{citation}}: Unknown parameter |month= ignored (help)
  2. ^ "About TXT records". Google Apps Administration. Google. Retrieved 17 August 2014.