Cloudflare SPF Setup

Sender Policy Framework - Step-by-step configuration guide

Prerequisites

  • Logged into Cloudflare dashboard
  • Domain added to Cloudflare

Configuration Steps

1

Go to DNS Management

Log in to Cloudflare → Select your domain → Click "DNS" in the left menu → "Records"

2

Add TXT Record

Click the "Add record" button

3

Configure SPF Record

Select Type "TXT", Name "@" (represents root domain), Content is your SPF value

If an SPF record already exists, edit it instead of creating a new one. Only one SPF record per domain is allowed.
4

Save and Verify

Click "Save". DNS propagation may take a few minutes to hours.

Use "dig TXT yourdomain.com" command to verify it's working

Example Configuration

Example SPF Value

v=spf1 include:_spf.google.com include:spf.protection.outlook.com -all

⚠️ This is an example value. Modify it according to your email service provider's requirements.

Verify Your Configuration

Terminal Command
$ dig TXT yourdomain.com +short

Replace "yourdomain.com" with your actual domain name

Common Mistakes to Avoid

  • Creating multiple SPF records (should only have one)
  • Using ~all instead of -all (recommend using -all for stricter policy)
  • Forgetting to add include for all email sending services

Verify Your SPF Configuration

After setting up your SPF record, use our free checker to verify it's correctly configured.

Check Your Domain Now