How to Set Up SPF for Cloudflare Email Routing

Configure SPF for domains using Cloudflare Email Routing to ensure forwarded and routed email passes authentication.

Quick Answer — The Record You Need

Record Type

TXT

Host / Name

@

Value
v=spf1 include:_spf.mx.cloudflare.net ~all

This SPF include is for Cloudflare Email Routing. Cloudflare itself is not an email sender -- it routes email to your actual mailbox provider.

Step-by-Step Setup

1

Log in to Cloudflare

Go to dash.cloudflare.com and sign in.

2

Select your domain

Choose the domain where you want to set up Email Routing.

3

Enable Email Routing

Go to Email > Email Routing. Follow the setup wizard to configure routing rules.

4

Add the SPF record

Cloudflare may auto-add DNS records during Email Routing setup. If not, add the SPF include manually.

v=spf1 include:_spf.mx.cloudflare.net ~all
5

Verify configuration

Send a test email to your routed address and confirm delivery and SPF pass.

Before & After

Before
v=spf1 include:_spf.google.com ~all
After
v=spf1 include:_spf.google.com include:_spf.mx.cloudflare.net ~all

Common Gotchas

  • Cloudflare is not an email sender. The include:_spf.mx.cloudflare.net is only needed if you use Cloudflare Email Routing.
  • If you use Cloudflare only for DNS (not Email Routing), you do not need this SPF include. Add the includes for your actual email provider instead.
  • Cloudflare Email Routing forwards email. The SPF record authorizes Cloudflare's routing servers, not your final mailbox provider.

Verify Your Setup

After adding your DNS records, use our free SPF checker to verify everything is configured correctly. DNS changes typically propagate within minutes, but can take up to 48 hours.

Frequently Asked Questions

Do I need an SPF record for Cloudflare?

Only if you use Cloudflare Email Routing. If Cloudflare is just your DNS provider, add SPF records for your actual email service instead.

What is Cloudflare Email Routing?

Cloudflare Email Routing lets you create email addresses on your domain and forward them to existing mailboxes (like Gmail). It does not host mailboxes.

Can I use Cloudflare Email Routing with Google Workspace SPF?

Yes. Combine both: v=spf1 include:_spf.google.com include:_spf.mx.cloudflare.net ~all.

Related Guides