What is txt record in dns

Last updated: April 1, 2026

Quick Answer: A TXT record is a DNS record that stores text information associated with a domain name. It's used for domain verification, email authentication (SPF and DKIM), and other text-based domain metadata.

Key Facts

Understanding TXT Records

A TXT record is a type of DNS (Domain Name System) record that stores text information associated with a domain name. Unlike other DNS records that typically contain specific data formats (like IP addresses in A records), TXT records can contain arbitrary text strings. This flexibility makes them useful for various purposes including domain verification, email authentication, and other administrative functions.

What is DNS?

Before understanding TXT records, it's important to understand DNS. The Domain Name System is the internet's directory service that translates domain names (like example.com) into IP addresses that computers can understand. DNS records come in various types, each serving specific purposes. TXT records are one of these types, specifically designed to hold human-readable text.

Common Uses of TXT Records

TXT records serve several important functions in email and domain management:

SPF and Email Authentication

One of the most important uses of TXT records is email authentication. SPF (Sender Policy Framework) records specify which IP addresses or mail servers are permitted to send emails from your domain. For example, an SPF record might state that only your company's mail server can send emails from your domain. This prevents spammers from sending emails that appear to come from your domain. Mail servers check the SPF TXT record before accepting emails, helping reduce spam and phishing attacks.

DKIM and Email Signatures

DKIM (DomainKeys Identified Mail) uses TXT records to store public cryptographic keys. When your mail server sends an email, it signs the message with a private key. Recipients can retrieve the corresponding public key from your DKIM TXT record and verify the signature, confirming that the email genuinely came from your domain and hasn't been altered in transit.

Technical Details

TXT records have specific technical specifications. Each TXT record can contain one or more character strings, with each string limited to 255 characters. If you need to store more than 255 characters, you can use multiple strings within the same record. TXT records are queried just like other DNS record types, making them easy to implement. Domain registrars and DNS management platforms provide interfaces to add and modify TXT records.

Related Questions

How do I add a TXT record to my domain?

Log into your domain registrar or DNS hosting provider, find the DNS management section, and add a new TXT record with the required text value. Most providers offer a simple form where you specify the record type (TXT), name (if needed), and the text content.

What is the difference between SPF and DKIM?

SPF records specify which mail servers can send emails from your domain, while DKIM records contain cryptographic keys that digitally sign your emails. Both work together to authenticate emails and prevent spoofing and phishing attacks.

How long does a TXT record take to propagate?

TXT record changes typically propagate across the internet within 24-48 hours, though some changes may take effect sooner. The propagation time depends on DNS cache settings (TTL values) configured by your DNS provider.

Sources

  1. Wikipedia - TXT Record CC-BY-SA-4.0
  2. RFC 7208 - SPF Protocol Public Domain