Quick summary
- What it is: A TXT Record (Text Record) is one of the types of records in the Domain Name System (DNS) that allows administrators to insert arbitrary text into the DNS record.
- What it's for: it helps connect the domain with the website, email and other associated services.
- When to check it: when changing DNS servers, connecting a domain, configuring email or reviewing propagation.
A TXT Record (Text Record) is one of the types of records in the Domain Name System (DNS) that allows administrators to insert arbitrary text into the DNS record of a domain. This type of record is frequently used to provide additional information about a domain or to verify domain ownership in certain online services.
Common uses of TXT records:
-
Domain ownership verification: Many online services, such as Google Search Console and other web analytics services, require domain owners to verify their ownership by adding a specific TXT record in their DNS. This record contains a unique value provided by the service to confirm that the user adding the record has administrative control over the domain.
-
Implementation of email policies: TXT records are used to implement and configure protocols that help reduce spam and email abuse, such as SPF (Sender Policy Framework), DKIM (DomainKeys Identified Mail) and DMARC (Domain-based Message Authentication, Reporting & Conformance). These records help verify that email messages come from authorized sources and can provide instructions on how to handle messages that fail these checks.
- SPF: Specifies which mail servers are authorized to send email on behalf of a domain.
- DKIM: Allows an organization to take responsibility for a message that is in transit. The TXT record contains the public key used to verify the digital signature of the message.
- DMARC: Defines the handling policy for emails that fail SPF and DKIM checks, providing additional instructions to improve protection against phishing and other types of email abuse.
-
General information: Some services or applications may use TXT records to store user-configured information that needs to be publicly accessible but does not fit any other standard DNS record type.
Format of a TXT record:
The TXT record simply consists of a text string that can contain any textual data. The structure in a DNS zone file might look something like this:
example.com. IN TXT "v=spf1 ip4:192.168.0.1 -all"
This example shows a TXT record used for an SPF record, which specifies that only the server with IP address 192.168.0.1 is authorized to send emails on behalf of "example.com", and that any other server should be treated as unauthorized.
Considerations when using TXT records:
- Security: Although TXT records can be useful for many configurations, it is important to be aware of security. Sensitive information should never be stored in a TXT record since it is publicly accessible.
- Size and length: TXT records have limitations in terms of length. Longer entries may need to be segmented into multiple text strings within the record.
TXT records are a flexible tool within the DNS system that provides a way to extend information about the domain and its associated policies in a standard and accessible manner.
Why it matters in hosting
Understanding this concept will help you make better decisions when managing your service. In practice, it relates to the connection between the domain, the website, email and other associated services. If it appears in a guide, the control panel or a support response, review the context before making changes.
Related articles
- Domain
- DNS
- Nameservers
- A Record
- CNAME Record