Add SPF, DKIM, DMARC in Cloudflare DNS
Cloudflare's proxy orange cloud does not apply to TXT. The mistake is still editing SPF on the wrong subdomain or duplicating records during a migration.

Cloudflare DNS vs Cloudflare Proxy
Right, email authentication records are plain DNS TXT (and sometimes CNAME for certain DKIM setups). The orange-cloud proxy toggle on A records does not publish or hide TXT. You edit TXT in the DNS tab for the zone, whether the website is proxied or not.
Names that matter
| Record | Typical name in Cloudflare |
|---|---|
| SPF | `@` (apex) TXT |
| DKIM | `selector._domainkey` TXT (example: `google._domainkey`) |
| DMARC | `_dmarc` TXT |
Warning
“Orange cloud on your website does not publish SPF. TXT in the DNS tab does.”
Publish SPF in Cloudflare
One merged `v=spf1` row on `@` is the whole game here. If you already have SPF, edit that row instead of adding another TXT on `@`.
Open Cloudflare Dashboard > your zone > DNS > Records.
If no SPF exists, Add record > Type TXT > Name `@` > Content starting with `v=spf1`. Google Workspace example: v=spf1 include:_spf.google.com ~all
If SPF already exists, Edit that row instead of adding a second TXT on `@`.
Add vendor `include:` tokens on the same line, separated by spaces. Save once.
Use dig or zerohook.org/spf-checker after TTL to confirm one record and lookup count.
Publish DKIM and DMARC
DKIM
Your mail provider gives a hostname like `google._domainkey` and a long public key string. Wrong selector name means pass in the UI and fail in Gmail. In Cloudflare, Add record > TXT > Name `google._domainkey` (Cloudflare appends your zone automatically). Paste the full key as Content. Cloudflare stores long TXT without manual splitting in most cases.
DMARC
Add TXT > Name `_dmarc` > Content: v=DMARC1; p=none; rua=mailto:[email protected]; adkim=r; aspf=r; Replace the rua address with a mailbox you read. Start at `p=none` until reports stay clean.
Pro tip
Warning
Frequently Asked Questions
Key takeaways
Edit SPF plus DKIM plus DMARC in Cloudflare DNS as TXT on the correct hostnames.
Merge to one `v=spf1` on `@`; duplicate TXT rows break SPF evaluation.
Long DKIM keys usually fit in one Cloudflare TXT content field.
Start DMARC at `p=none` with a working `rua` before enforcement.
Verify all three layers together after TTL, not just the record Cloudflare's UI turns green.
Share this analysis
Help others discover this content
More from our blog

Why Gmail Sends Your Email to Spam
Why Gmail sends mail to spam: SPF/DKIM/DMARC alignment, spam rate and complaints, plus list hygiene fixes that actually move inbox placement.

How to View Email Headers in Gmail
View email headers in Gmail, Outlook, and Apple Mail: open Show original, find Authentication-Results, and read spf=, dkim=, and dmarc= without guessing.

How to Read Gmail Postmaster Tools
Read Gmail Postmaster Tools: verify your domain, domain reputation, spam rate near 0.3%, and authentication charts versus what headers show on a single message.