# How to Add an SPF Record to Cloudflare - Easy Setup Guide

Last updated: July 27, 2025

.png)

## How to Set Up an SPF Record in Cloudflare

These are the main steps to set up an SPF record in Cloudflare:

**Step 1:** Get your email service provider’s SPF record  
**Step 2:** Check your domain’s DNS records for an existing SPF record  
**Step 3:** Add your SPF record to Cloudflare  
**Step 4:** Check if your SPF record is working

.png)

### 1. Get your email service provider’s SPF record

An SPF record lets you specify what servers can send email on your domain’s behalf.

If Google Workspace is your ESP, you must add their servers to the SPF record. Similarly, if you use the mail servers of your hosting company, they should be added to it.

If you use Google, then the SPF record to set up should look like this: **v=spf1 include:_spf.google.com ~all**

## SPF Record Generator

### 2. Check your domain’s DNS records for an existing SPF record

You cannot have multiple SPF records in Cloudflare or any other domain provider. Having multiple SPF records for your domain can lead to authentication failures.

### 3. Add an SPF record to Cloudflare

**Step 1:** Log in to Cloudflare  
**Step 2:** Select your domain  
**Step 3:** Click on **DNS**  
**Step 4:** Create a new DNS record  
**Step 5:** Set the record’s **Type** to **TXT**.  
**Step 6:** Enter @ in the **Name** field  
**Step 7:** Paste your ESP’s SPF record in the **Value** field.  
**Step 8:** Leave the **TTL** to the default.  
**Step 9:** Save your record

### 4. How to check if your SPF record is working

This is the most time-consuming step of setting up an SPF record. Not because it’s a lot of work, but rather because of the waiting time.

You can use several tools to check the status of your SPF record. One such tool is Mailivery's DNS Status meter.

.png)

**Cloudflare SPF record not working?**  
_Make sure your SPF record’s syntax is correct! Use Mailivery’s free Syntax Checker to verify it:_

## What Does SPF Mean?

Sender Policy Framework.  
SPF is an email security protocol designed to prevent spammers from sending emails on behalf of your domain.

**What does an SPF record look like?**

Here’s an SPF record example someone might need to set up on Cloudflare:

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

A **hard fail** is stricter and better for security.  
But when you're first setting up your SPF record, it's safer to start with **soft fail** for testing.

**Note**: What really happens to emails that fail authentication also depends on other factors like server configuration and DMARC settings.

## SPF Benefits

SPF makes your emails more secure by combating email spoofing.  
However, even better, it’ll also lead to more prospects reading your emails. Email service providers check if your domain has an SPF record set up. If it does, and it’s configured correctly, they will trust your emails more, leading to better inbox placement.

## What About DKIM and DMARC?

SPF alone is not enough. You also need to set up your DKIM and DMARC records.  
In short, if you want your emails to reach the inbox, book meetings, and drive revenue, you must set up all three: SPF, DKIM, and DMARC.
