Back to Help Center
DNS & RECORDS September 11, 2026 · 4 min read

How to Add a TXT Record in Cloudflare (Step-by-Step)

Cloudflare's DNS UI adds TXT records in 4 clicks: DNS → Records → Add record → Type TXT → Save.

Adding a TXT record in Cloudflare takes about 2 minutes end-to-end.

Prerequisites

  • Cloudflare account with your domain added as a zone
  • Cloudflare’s nameservers assigned to your domain (verify with the DNS query tool)

Step 1 — Navigate to DNS Records

  1. Log into Cloudflare dashboard
  2. Select your domain from the site list
  3. Left sidebar → DNSRecords

Step 2 — Click Add Record

Blue Add record button at the top.

Step 3 — Fill in the Fields

  • Type — TXT
  • Name — depends on the record purpose:
    • SPF → @ (root domain)
    • DMARC → _dmarc
    • DKIM → {selector}._domainkey (e.g., google._domainkey)
    • Google Site Verification → @
    • Microsoft 365 Verification → @
  • Content — the TXT value, e.g., v=spf1 include:_spf.google.com ~all
  • TTL — Auto (Cloudflare’s default) — usually fine

Step 4 — Save

Cloudflare propagates the change to its global anycast network within seconds.

Step 5 — Verify

Wait 30-60 seconds. Verify with the DNS query tool — enter your domain and the record name. Expected: the TXT value you just published.

For SPF: use the SPF lookup tool. For DMARC: the DMARC lookup tool. For DKIM: the DKIM lookup tool.

Long Records (DKIM)

DKIM public keys often exceed 255 characters. Cloudflare handles the string-splitting automatically — paste the whole value in one field.

Cloudflare Proxy Does Not Apply

The orange cloud (proxy) only affects HTTP/HTTPS records (A, AAAA, CNAME). TXT records are served directly, unaffected by proxy state.

Common Miss

  • Using @ when the record needs a subdomain — SPF at @, DMARC at _dmarc, DKIM at {selector}._domainkey
  • Adding two SPF records → PermError — always merge into one
  • Missing the leading underscore on _dmarc — record won’t be recognized

Verify with the DNS query tool.

Browse every major DNS record type, check the DNS glossary entry, and see the TXT record glossary entry.