Skip to main content
DNSnexus
Free Developer Tools
DNS
Email
Network
Webmaster
Security
IP
Guides
Live Tools
60+
Categories
6
Result URLs
Shareable
Availability
24/7
DNSnexus
Free Developer Tools
Free DNS, email, network, and security diagnostics with crawlable tool pages and shareable result URLs.
Run DNS CheckBrowse All Tools
Popular Tools
DNS Propagation CheckerDNS LookupWHOIS LookupSPF Record CheckerDMARC CheckerSSL Certificate CheckerPort Scanner
Quick Path
Fix Email Deliverability
Quick Path
Troubleshoot DNS Changes
Quick Path
Validate SSL & Open Ports
DNS Tools
A Record LookupAAAA Record LookupCERT LookupCNAME LookupDNS CheckDNS LookupDNS Propagation CheckerDNSKEY LookupDS LookupIPSECKEY LookupLOC LookupNS LookupNSEC LookupNSEC3PARAM LookupReverse DNS LookupRRSIG LookupSOA LookupSRV LookupTXT LookupWHOIS Lookup
Email Tools
BIMI LookupBlacklist CheckDKIM CheckerDMARC CheckerDMARC Report AnalyzerEmail Deliverability ReportEmail Header AnalyzerEmail Health ReportGoogle/Yahoo Compliance CheckerMicrosoft Compliance CheckerMTA-STS LookupMX Record LookupSMTP TestSPF Record Checker
Network Tools
HTTP LookupHTTPS LookupMAC Address GeneratorMAC Address LookupOnline TraceroutePingSubnet Calculator
Webmaster Tools
HTTP Headers CheckSearch Presence CheckWebsite Link AnalyzerWebsite Operating System CheckWebsite Redirect CheckerWhat is My User Agent?
Security Tools
DKIM Record GeneratorDMARC GeneratorDomain DNS Security CheckEmail Security CheckerPort ScannerSPF GeneratorSSL Certificate CheckerWebsite Vulnerability Scanner
IP Tools
ARIN LookupASN LookupIP Blacklist CheckIP Geolocation LookupWhat Is My IP
Company
All Tools DirectoryGuides & PlaybooksAbout DNSnexusContactAPI DocsPrivacy PolicyTerms & ConditionsCookie Policy
© 2026 DNSnexus — DNS, Email, Network & Security Tool Platform
All ToolsAboutContactPrivacyTerms
Home › Guides › DNS Diagnostics › How to Add a TXT Record in Cloudflare
DNS Diagnostics•8 min•Published 2026-03-01

How to Add a TXT Record in Cloudflare

Domain verification for Google Workspace, Microsoft 365, or SSL certificates almost always comes down to one task: add a TXT record to Cloudflare's DNS and wait for it to propagate. The dashboard steps are simple, but the record is easy to get wrong — a stray quote, a name field with the wrong suffix, or a duplicate `v=spf1` string will make the verification fail silently.

Quick Answer
In Cloudflare, go to your domain → DNS → Records → Add record, set type to TXT, paste the exact Name and Content the third party gave you, leave TTL on Auto, and click Save. TXT records can't be proxied, so there's no orange/grey toggle to set — propagation is usually complete within 5 minutes.

What Is a TXT Record and Why Cloudflare Needs One

A TXT (text) record is a DNS record type that stores arbitrary text data at a hostname, defined in RFC 1035 §3.3.14. Each string inside a TXT record is limited to 255 bytes, but a single record can concatenate multiple strings — which is why long SPF or DKIM values sometimes get auto-split across quoted segments. Cloudflare stores whatever content you paste and serves it back over standard DNS queries; it does not interpret or validate the string's meaning.

Cloudflare uses TXT records for the same purposes any DNS provider does: proving domain ownership (Google Search Console, Microsoft 365, Zoho, GitHub Pages), publishing email authentication policy (SPF, DKIM, DMARC), and satisfying ACME challenges for wildcard SSL certificates. Because TXT is a general-purpose container, one domain can have dozens of TXT records at different names — @, _dmarc, google._domainkey, and so on — without conflict, as long as none of them duplicate the same name + identical prefix (the classic SPF "two records" bug covered below).

Cloudflare's dashboard doesn't distinguish "verification TXT" from "SPF TXT" — they're all the same record type, just with different names and content. Understanding that upfront prevents a common mistake: creating a second v=spf1 record instead of editing the existing one when you add a new mail provider. If you're setting up mail auth specifically, see the SPF Record Generator guide for building the value correctly before you paste it here.

Step-by-Step: Adding a TXT Record in Cloudflare

  1. Log in to the Cloudflare dashboard and select the domain from your account's domain list. If you manage multiple domains, confirm you're on the right one before editing DNS — Cloudflare doesn't warn you twice.

  2. Open DNS → Records. This is the same screen you'd use to check A or CNAME records. Click Add record in the top right.

  3. Set Type to TXT. The form fields change slightly for TXT — there's no proxy toggle, because TXT records are always DNS-only and can't route through Cloudflare's edge network.

  4. Enter the Name exactly as given. This is where most verification failures happen. If the third party says _dmarc.example.com, enter _dmarc (Cloudflare appends your zone apex automatically). For a root-domain record, use @. Don't include the domain twice — _dmarc.example.com.example.com is a common copy-paste error.

  5. Paste the Content field exactly, including quotes if given. Copy-paste rather than retype; TXT values are case-sensitive and a single dropped character invalidates SPF, DKIM, and most verification tokens.

  6. Leave TTL on Auto unless you're actively troubleshooting propagation, in which case drop it to 60 seconds temporarily, save, wait for the change to take effect, then raise it back once verification succeeds.

  7. Click Save. Cloudflare re-formats the quoting on save (wrapping the value in matched double quotes) — if the record displays oddly afterward, open it and re-save once; this fixes most cosmetic quote-mismatch warnings.

  8. Confirm propagation before re-checking with the third party — see the CLI and tool checks below. Most Cloudflare TXT changes are visible globally within 5 minutes because Cloudflare's authoritative nameservers update near-instantly; any delay you see is almost always resolver caching downstream, not Cloudflare.

Name Field Reference Table

PurposeName field (in Cloudflare)Example ContentTypical caller
Root domain verification@google-site-verification=abc123...Google Search Console
SPF record@v=spf1 include:_spf.google.com ~allAny mail provider
DKIM selector[selector]._domainkeyv=DKIM1; k=rsa; p=MIGfMA0G...Google Workspace, M365
DMARC policy_dmarcv=DMARC1; p=quarantine; rua=mailto:...DMARC report tools
ACME wildcard cert challenge_acme-challenge[token from CA]Let's Encrypt, cert clients
Domain ownership (generic)@ or subdomain given by tooltool-specific token stringGitHub Pages, Netlify, Zoho

The Name field is the single most common source of TXT record failures in Cloudflare — a mismatched selector or an extra domain suffix produces a record that saves successfully but never matches what the verifying service looks up.

Verifying the Record with dig and nslookup

Run these from a terminal after saving, using your zone's actual name in place of example.com:

Code
# Query the TXT record directly from Cloudflare's authoritative nameservers
dig TXT _dmarc.example.com @<cloudflare-ns-for-your-zone>.ns.cloudflare.com +short

# Query from your local resolver to check what's actually propagated to you
dig TXT example.com +short
Code
# Windows/macOS equivalent
nslookup -type=TXT _dmarc.example.com

If the direct-to-Cloudflare query returns the record but your local resolver doesn't yet, the record itself is correct and you're waiting on resolver cache TTL — not a Cloudflare misconfiguration. Cross-check global visibility with the DNS Propagation Checker, or confirm the exact record set with the DNS Lookup tool.

Common Issues & Troubleshooting

Problem: The verifying service says the TXT record isn't found, but Cloudflare shows it saved. Cause: usually a Name field mismatch — a trailing domain suffix, wrong selector, or the record was added to a different zone (e.g., a staging domain instead of production). Fix: re-open the record in Cloudflare and compare the Name character-for-character against what the third party specified, then re-verify with dig.

Problem: SPF stopped working after adding a new TXT record. Cause: two v=spf1 records now exist at the same name. RFC 7208 §4.5 requires exactly one SPF record per domain — two or more causes a PermError, which most receivers treat as an outright SPF fail. Fix: merge both include: mechanisms into a single v=spf1 string rather than adding a second record. See the SPF Record Generator guide for building one merged value.

Problem: Long DKIM key gets rejected or truncated. Cause: DKIM public keys frequently exceed 255 bytes, and some third-party tools generate the value already pre-split into quoted segments ("part1" "part2"), which Cloudflare expects verbatim. Fix: paste the full string exactly as your provider gave it, including any existing quote splits. Don't manually re-wrap or shorten it. See the DKIM Selector guide for selector-naming specifics.

Problem: Record shows in Cloudflare but a global checker reports NXDOMAIN. Cause: the zone's nameservers at the registrar don't point to Cloudflare yet, so none of Cloudflare's DNS is authoritative for the domain. Fix: confirm delegation with the NS Lookup tool before troubleshooting the TXT record itself — a record in the right zone with the wrong nameservers upstream will never resolve publicly.

Key Takeaways

  • ✓ TXT records in Cloudflare are always DNS-only — there's no proxy toggle to configure.
  • ✓ Per RFC 1035, each string in a TXT record is capped at 255 bytes; long values get auto-split into quoted segments.
  • ✓ A domain must have exactly one v=spf1 TXT record (RFC 7208 §4.5) — a second one causes PermError, not stacking.
  • ✓ Cloudflare propagation is typically under 5 minutes; longer delays are almost always downstream resolver caching, not Cloudflare.
  • ✓ Verify the Name field character-for-character — it's the single most common cause of "saved but not found" verification failures.

Frequently Asked Questions

Q: How long does a TXT record take to propagate in Cloudflare?

Cloudflare's own authoritative nameservers update within seconds to a few minutes. Full global visibility depends on downstream resolver caching and typically finishes within 5–15 minutes for a new record with default TTL.

Q: Can I add multiple TXT records with the same name in Cloudflare?

Yes, technically — Cloudflare allows multiple TXT records at one name. But for SPF specifically, having two v=spf1 records causes a PermError per RFC 7208; other TXT uses (DKIM selectors, verification tokens) are fine to coexist as long as names don't collide.

Q: Why does Cloudflare add quotes around my TXT value automatically?

DNS represents TXT content as quoted character-strings per RFC 1035. Cloudflare's dashboard formats the value into that format on save; this is cosmetic and doesn't change the underlying data returned to resolvers.

Q: Do I need to set proxy status for a TXT record?

No. Only A, AAAA, and CNAME records support Cloudflare's proxy (orange cloud). TXT, MX, and most other record types are always served DNS-only.

Q: Why does my SPF record still fail after I fixed the TXT record?

Check for a duplicate v=spf1 record first — that's the most common cause. If there's only one, confirm you're under the 10 DNS-lookup limit per RFC 7208 §4.6.4, since include: mechanisms count toward it even after the syntax is correct.

Q: Can I use a TTL lower than Auto to speed up verification?

Yes — set it to 60 seconds while troubleshooting, then raise it back to Auto once verification succeeds. A low TTL doesn't make the initial Cloudflare-side propagation faster, but it shortens how long a stale cached answer persists if you need to edit the record again.

Q: What's the difference between adding a TXT record for SPF vs. for domain verification?

None at the DNS level — both are just TXT records with different Name and Content values. The distinction only matters for which service reads the record and what syntax it expects.

Next Steps

Once the record is saved, confirm it resolves correctly with the DNS Lookup tool and check global propagation with the DNS Propagation Checker. If verification still fails after the record looks correct in both, confirm your domain's nameservers actually point to Cloudflare using the NS Lookup tool, or check for a stale reverse mapping with Reverse DNS Lookup. For deeper background on TXT record syntax and other record types, see DNS TXT Records Explained, and if you're migrating this domain's DNS entirely, read How to Change DNS Servers first. Managing DNS at a different registrar instead? See How to Add a TXT Record in GoDaddy or How to Add a TXT Record in Namecheap for the equivalent steps.

Free Newsletter

Get guides like this by email

DNS, email auth, and security playbooks delivered when they publish. No spam.

On this page
  • What Is a TXT Record and Why Cloudflare Needs One
  • Step-by-Step: Adding a TXT Record in Cloudflare
  • Name Field Reference Table
  • Verifying the Record with dig and nslookup
  • Common Issues & Troubleshooting
  • Key Takeaways
  • Frequently Asked Questions
  • Next Steps
Related links
Dns LookupDns Propagation CheckerNs LookupReverse DnsDns Txt Records ExplainedSpf Record Generator Guide
Related Tools
DNS Propagation Checker→DNS Check→DNS Lookup→A Record Lookup→