What is a DNS TXT record?

DNS TXT Record (Text) is a type of DNS record that stores text information, such as descriptions or special notes, associated with domain names.

Purpose:

  • Provides additional information or records that cannot be stored in other types of DNS records.
  • Used for various purposes, including:
  • Verification of domain ownership (for example, for email authentication)
  • Storing policy-related information (e.g., to prevent email forgery)
  • Specifying contact information or technical records

Structure:

TXT records have the following structure:

name_domain. IN TXT "text-value" 
  • name_domain: The domain name associated with the record.
  • IN: Indicates that this is a DNS record.
  • TXT: Indicates the type of record.
  • text-value: The text value stored in the record.

Example:

example.com. IN TXT "spf1 mx -all" 

This example creates a TXT record for the domain "example.com" with the text value "spf1 mx -all", which is used to configure the SPF (Sender Policy Framework) policy for the domain.

Notes:

  • The text value in a TXT record can be any string, but is usually limited to 255 characters.
  • TXT records are not case sensitive.
  • TXT records can be used to store any information relevant to the domain or its associated services.