Announcements

TXT Records Explained: The Hidden Power Behind Domain Security

Jul 24, 2025·Last updated on Jul 24, 2025

Share this article:

TXT records weren't built for security. Yet today, they're the backbone protecting your domain from email spoofing, phishing attacks, and unauthorized access. What started as simple text notes in DNS has evolved into one of the most versatile tools for domain verification and email authentication.

If you've ever set up email services or verified domain ownership for Google Workspace, you've worked with TXT records. These DNS entries store machine-readable data that powers SPF authentication, DKIM signatures, DMARC policies, and domain verification systems. The result? Your emails reach inboxes instead of spam folders, and your domain stays protected from impersonation attempts.

TXT records solve a fundamental problem: proving you control a domain. When someone tries to send emails from your domain or access services using your domain name, TXT records provide the verification mechanism that separates legitimate use from malicious activity.

This guide explains everything you need to know about TXT records—from their basic structure to advanced security implementations. You'll learn how these seemingly simple text entries create robust protection for your domains and establish trust in your digital communications.

What is a TXT DNS Record and Why It Matters

A TXT DNS record stores text information within the Domain Name System. Think of it as a flexible container where domain administrators can place both human-readable notes and structured data that machines can process.

Human-readable vs machine-readable content

What started as simple text notes evolved into something much more powerful. Early TXT records held basic information like contact details or server descriptions. But in 1993, the Internet Engineering Task Force changed everything by formalizing an "attribute=value" format for machine-readable data.

This shift transformed TXT records from basic note-keeping into authentication powerhouses. Today's TXT records handle both human notes and complex verification protocols. The dual capability means you can store technical data while keeping it understandable for administrators who need to manage these systems.

This flexibility matters because security standards keep evolving. Instead of creating new DNS record types for every innovation, TXT records adapt to support whatever verification method comes next.

Multiple TXT records per domain: is it allowed?

Yes, domains can have multiple TXT records. This capability is just as essential as it is convenient. Modern domains need separate records for SPF email authentication, DKIM signatures, DMARC policies, and service verifications like Google Workspace.

Some services support multiple TXT records with identical names but different values. Route53's documentation specifies: "Enter multiple values on separate lines. Enclose entries in quotation marks". However, certain protocols like SPF break with multiple records—only one SPF-formatted record works per domain.

dns txt record example for basic usage

Here's how a basic TXT record looks:

This SPF record example shows the standard format. The value field holds your verification or policy data. When text exceeds 255 characters, it splits into multiple quoted strings that DNS systems reassemble.

TXT records serve three main purposes: verifying domain ownership, securing email through authentication protocols, and providing flexible verification for various online services.

Understanding TXT Record Format and RFC Standards

Three key RFC standards define how TXT records work. These specifications ensure every DNS system handles your TXT records the same way, whether you're using Cloudflare, Route53, or your domain registrar's DNS.

RFC 1035: TXT record structure and length limits

RFC 1035 laid the groundwork in 1987, establishing TXT records as containers for descriptive text. The basic format uses "one or more character-strings" with meaning that depends on where you place them.

The standard sets specific size boundaries:

  • Labels: 63 characters maximum
  • Domain names: 255 characters maximum
  • TTL values: positive 32-bit numbers only
  • UDP messages: 512-character limit

Each TXT record contains these fields: Name (your domain), Type (0x0010 for TXT), Class, TTL, Data Length, TXT Length, and the actual text string. This structure balances flexibility with DNS efficiency.

RFC 1464: attribute=value format

RFC 1464 changed everything in 1993. Instead of just storing random text, it standardized machine-readable data using "attribute=value" pairs. The format places the attribute name, an equals sign, and the value inside quotation marks.

host.widgets.com IN TXT "printer=lpr5"

sam.widgets.comINTXT"favoritedrink=orangejuice"

Special characters need careful handling. Equals signs in attribute names require a grave accent (`) for quoting. Attribute names ignore case, so "Favorite Drink" matches "favorite drink".

Handling long TXT records over 255 characters

Here's where things get tricky. Individual strings max out at 255 characters, but total TXT records can reach 65,535 bytes. DNS systems split longer records into multiple strings that applications reassemble.

DKIM signatures and complex SPF records often hit this limit. When splitting occurs, the format looks like: "v=spf1 include:spf.example.com" "include:spf.example2.com ~all"

This happens because TXT records lack built-in length counters or end markers. Getting the format wrong breaks authentication protocols that depend on these records.

How TXT Records Power Email Security Protocols

Email authentication lives in TXT records. These DNS entries store the cryptographic keys, server lists, and policies that determine whether your emails reach inboxes or get flagged as spam. Three core protocols—SPF, DKIM, and DMARC—work together to create a verification system that protects both senders and recipients.

SPF: Listing authorized mail servers

Sender Policy Framework (SPF) creates an authorized server list for your domain. When someone receives an email claiming to be from your domain, their mail server checks your SPF record to verify the sending server's legitimacy. Think of SPF as a bouncer list—only servers you approve can send emails on your behalf.

A basic SPF record follows this format:

v=spf1 include:_spf.google.com ~all

The v=spf1 tag identifies it as an SPF record, while include: tags list authorized senders. The final ~all tag instructs receiving servers to mark messages as spam if they come from unlisted servers.

DKIM: Public key in TXT record for signature verification

DomainKeys Identified Mail (DKIM) adds a digital signature to your emails using public-private key cryptography. Your private key signs outgoing messages, while the public key—stored in a TXT record—allows recipients to verify this signature.

DKIM records use a specialized naming format:

selector._domainkey.yourdomain.com

The selector identifies the specific DKIM key being used, enabling multiple keys under one domain. This flexibility lets you rotate keys or use different keys for different services.

DMARC: Policy enforcement using _dmarc subdomain

Domain-based Message Authentication, Reporting and Conformance (DMARC) builds upon SPF and DKIM by defining policies for handling authentication failures. DMARC records are published as TXT entries under the _dmarc subdomain.

A DMARC record might look like:

v=DMARC1; p=reject; pct=100; rua=mailto:reports@example.com

Here, p=reject instructs servers to block failed messages, while rua= specifies where to send authentication reports. DMARC turns authentication from advisory to enforceable.

BIMI and other emerging TXT-based protocols

Brand Indicators for Message Identification (BIMI) allows verified brand logos to appear alongside authenticated emails. BIMI requires DMARC implementation with p=quarantine or p=reject policies.

BIMI records are stored as TXT entries containing references to verified SVG logo files. This visual verification helps recipients instantly recognize legitimate messages from trusted senders. The protocol represents the evolution of email authentication from invisible security measures to visible trust indicators.

How to Add and Check TXT Records for Your Domain

Setting up TXT records correctly makes the difference between authenticated emails and messages that land in spam folders. The process varies by provider, but the core steps remain consistent across platforms.

Steps to add a TXT record at Unstoppable Domains

Log in to your Unstoppable Domains account and head to "My Domains" in your dashboard. Select the domain you want to configure and click on the "DNS Records" panel. Choose "TXT" as your record type, paste in the verification string from your email service or security protocol, then hit "Save".

Changes typically take effect within minutes—much faster than traditional DNS providers that can take hours to propagate. This speed advantage means you can test your email authentication setup almost immediately after configuration.

Lookup txt records using dig and nslookup

Command line tools give you the fastest way to verify your TXT records. Use dig on Mac/Linux systems:

dig domain txt

This shows all TXT records for your domain. Add "+short" to see just the record values without extra DNS information.

Windows users can run nslookup:

nslookup -type=TXT domain

Both tools tell you whether your records are live and visible to the internet. When you have multiple TXT records, dig usually provides cleaner, more complete output than nslookup.

Check txt records propagation with online tools

Browser-based DNS checkers offer visual alternatives to command line tools. MXToolbox, WhatsMYDNS, and NSLookup.io let you test TXT record propagation from multiple global DNS servers. These tools show you exactly where your records have updated and where they're still pending.

Common errors when adding TXT records

Four mistakes cause most TXT record failures. Adding extra quotation marks around values breaks verification systems. Typos in attribute names, domain references, or IP addresses prevent authentication. Testing records before DNS propagation completes gives false negative results. Exceeding the 255-character limit per string without proper splitting truncates your records.

Double-check your values before saving, wait a few minutes for propagation, then test using the verification tools your email service provides.

Beyond Email: TXT Records Power the Modern Web

Email authentication is just the beginning. TXT records have become the Swiss Army knife of domain verification, powering everything from website ownership to certificate validation across the digital ecosystem.

Website services depend on TXT records for domain verification. Google Search Console, Microsoft 365, Mailchimp—they all ask you to add a unique TXT record to prove domain ownership . This simple process unlocks access to powerful platforms and establishes legitimate control over your digital property.

Social media platforms use TXT records too. Facebook and Twitter require domain verification through TXT entries to connect websites with official social profiles . This verification prevents impersonation and builds credibility with your audience.

Certificate authorities have adopted TXT records for SSL/TLS validation. Instead of waiting for email verification, CAs can instantly confirm domain control when you add a specific TXT record. This speeds up certificate issuance and secures your site faster.

Developers use TXT records as configuration stores for applications. Rather than hard-coding settings, they can store dynamic values in DNS and update them without touching code . Site reliability engineers employ TXT records for service discovery and environment indicators in complex architectures.

Certificate Authority Authorization (CAA) records represent the latest evolution in TXT-based security. These entries restrict which certificate authorities can issue certificates for your domain, preventing unauthorized SSL certificate creation.

Best practices for TXT record management:

  • Document each record's purpose and expiration
  • Remove obsolete entries during regular reviews
  • Use descriptive prefixes for machine-readable records
  • Test thoroughly before deployment

TXT records continue adapting as internet security evolves. Their simplicity and universal DNS support make them ideal foundations for new protocols and verification systems. What started as simple text notes now powers critical infrastructure across the web.