Nodea — logo

TXT Record

A TXT record is a type of entry in a DNS zone that associates an arbitrary text string with a domain name. It was originally designed to hold human-readable notes, but over the years it became a general-purpose carrier for machine-read data. Today its main jobs are email authentication and proving that whoever configured the record actually controls the domain.

How a TXT record works

A TXT record consists of a host name, the type TXT, and a quoted value. When a resolver queries that name, the authoritative server returns the value — exactly the way an A record returns an IP address, except the payload is free-form text. A single TXT string is capped at 255 characters; longer values such as DKIM keys are split into several concatenated strings that the resolver stitches back together.

DNS itself assigns no meaning to the text — the application reading it decides what it means. A mail server looking for an SPF policy queries the domain's TXT records and interprets only the one starting with v=spf1, ignoring the rest.

TXT records in practice

The most common uses are:

  • SPF — the list of servers allowed to send mail for the domain,
  • DKIM — the public key used to verify a message's cryptographic signature,
  • DMARC — the policy for handling messages that fail SPF or DKIM,
  • ownership verification — Google Search Console, Microsoft 365 and certificate authorities ask you to add a unique TXT token.

TXT records are edited in the DNS panel of your hosting provider or registrar. After any change, confirm it with dig TXT yourdomain.com and remember that the update propagates according to the record's TTL. A correctly configured SPF, DKIM and DMARC trio measurably improves deliverability and makes it far harder for anyone to spoof your domain.

Powiązane pojęcia

Najczęstsze pytania

How many TXT records can a domain have?

There is no hard limit — a single name can hold multiple TXT records for different purposes, such as an SPF policy, a Google verification token and a DKIM key on a separate subdomain. The one exception is SPF: only a single record beginning with v=spf1 is valid per name.

Should I publish a DKIM key as a TXT record or a CNAME?

You can do either. Publishing the key directly as TXT keeps everything in your zone, while pointing a CNAME at your mail provider lets them rotate keys without you editing DNS each time. Managed providers usually recommend the CNAME approach.