How to set up SPF, DKIM and DMARC on Cloudflare

4 December 2026 · 6 min read

Cloudflare's DNS is fast, free and popular with developers. This guide shows where SPF, DKIM and DMARC records go in the Cloudflare dashboard, the settings that matter for email, and the mistakes that stop records from verifying. It uses the records an email service gives you for a sending subdomain such as notify.example.com.

Before you start: is your DNS at Cloudflare?

If your domain shows as Active in your Cloudflare dashboard, its nameservers point to Cloudflare and this is where records go, even if you bought the domain at GoDaddy or Hostinger. Records you add at the registrar are then ignored.

The records you'll add

Your email service shows the exact values; the DKIM key is unique to your domain.

PurposeTypeNameContent
DKIMTXTtrivsend._domainkey.notifyv=DKIM1; k=rsa; p=MIIBIjAN...
Return pathMXbounces.notifymail.trivsend.com, priority 10
SPFTXTbounces.notifyv=spf1 include:_spf.trivsend.com ~all
DMARCTXT_dmarc.notifyv=DMARC1; p=none; rua=mailto:...

Cloudflare accepts the Name either as the short form above or as the full name (bounces.notify.example.com); it works out which you meant. The short form is the safest habit, because it works in almost every DNS panel.

Step by step

  1. Sign in to Cloudflare and click your domain.
  2. Open DNS, then Records, and click Add record.
  3. Fill in the fields as below and click Save.
  4. Repeat for each row in the table above.
FieldWhat to enter
TypeTXT or MX
NameThe name from the table
Content (TXT) or Mail server (MX)Paste it exactly
Priority10 (MX only)
TTLAuto

Settings that matter for email

Check that it worked

Cloudflare changes are usually live within a minute or two. Then:

  1. Run the free domain checker on your domain to see each record as mailbox providers see it.
  2. Click Verify in your email service.

If a record isn't found, check for a typo in the name (for example _dmarc written as dmarc) and that the DKIM content wasn't cut short.

The faster way: let TrivSend add them

For a domain on Cloudflare, TrivSend can add all four records for you. You create a Cloudflare API token limited to that one zone's DNS, paste it once, and TrivSend adds only its own records: it merges an existing SPF record instead of overwriting it, keeps an existing DMARC record, and tells you about any clash. The token is used once and never stored.

Next steps

Start free with TrivSend: 3,000 emails a month, with DNS set up for you on Cloudflare.