SPF Setup for Cloudflare DNS

December 3, 2025 • InboxGreenEmail Team

🚨 DKIM issues can silently kill replies.

If opens dropped, replies disappeared, or bounces increased, treat it as an incident. Run the scan and get a fix path.

No signup required. Works on any domain.

SPF Setup for Cloudflare DNS

Setting up SPF records can feel like a daunting task, especially when you're using Cloudflare DNS. If you're a SaaS founder, marketer, or someone who manages email sending, you know that getting your emails into the inbox is crucial. A misconfigured SPF record can lead to deliverability issues, causing your emails to land in the spam folder instead of the inbox. Let’s break down how to set up SPF records in Cloudflare DNS, step by step.

Understanding SPF Basics

SPF, or Sender Policy Framework, is an email authentication method that helps to prevent spoofing. It allows you to specify which mail servers are permitted to send emails on behalf of your domain. Without a proper SPF record, you risk your messages being marked as spam or rejected altogether.

Here’s a quick overview of how SPF works:

  • When an email is sent, the receiving server checks the SPF record of the sending domain.
  • The SPF record lists the IP addresses or domains authorized to send emails for that domain.
  • If the sending server's IP is not listed, the email may be flagged as suspicious.

Diagnosing Your Current SPF Setup

Before diving into the setup, you need to check if you already have an SPF record. Use the InboxGreen checker to analyze your current DNS records. This tool will help you identify any issues with your SPF configuration.

Setting Up SPF in Cloudflare

Now, let’s get into the nitty-gritty of setting up your SPF record in Cloudflare DNS. Follow these steps carefully.

Step 1: Log into Cloudflare

First, log into your Cloudflare account. Navigate to the dashboard and select the domain for which you want to set up the SPF record.

Step 2: Access DNS Settings

Once you are in the domain settings, click on the “DNS” tab. This is where you will manage all your DNS records.

Step 3: Add or Edit Your SPF Record

If you already have an SPF record, you will see it listed here. If not, you will need to create one. Click on “Add Record” and select “TXT” as the type.

Here’s a basic format for an SPF record:

v=spf1 include:example.com -all

Replace example.com with your email service provider’s domain. For instance, if you are using Google Workspace, your record would look like this:

v=spf1 include:_spf.google.com -all

This record means that only Google’s servers are allowed to send emails on behalf of your domain. The -all at the end indicates a hard fail for any other servers. You can also use ~all for a soft fail, which is less strict.

Step 4: Save Your Changes

After entering your SPF record, click “Save.” Changes may take a few minutes to propagate, but you can check immediately using the InboxGreen checker again.

Common Gotchas

Here are some common pitfalls to watch out for:

  • Multiple SPF Records: You can only have one SPF record per domain. If you have multiple, they will conflict, and your emails may not be authenticated properly.
  • Incorrect Syntax: Make sure your SPF record follows the correct syntax. Even a small typo can lead to deliverability issues.
  • Too Many DNS Lookups: SPF records can only include up to 10 DNS lookups. If you exceed this limit, the SPF check will fail.

DKIM and DMARC: The Perfect Trio

While SPF is essential, it’s not the only player in the game. DKIM and DMARC work hand in hand with SPF to enhance your email security and deliverability.

DKIM (DomainKeys Identified Mail) adds a digital signature to your emails, allowing the receiving server to verify that the email has not been altered in transit. DMARC (Domain-based Message Authentication, Reporting & Conformance) builds on SPF and DKIM, providing instructions on how to handle emails that fail authentication checks.

To set up DKIM, you will need to generate a DKIM key using a tool like the DMARC generator. Once you have the key, add it as a TXT record in Cloudflare DNS, similar to how you added the SPF record.

What to Do Next

Now that you have your SPF record set up, it’s time to monitor your email deliverability. Use the InboxGreen checker regularly to ensure your records are functioning as intended. If you run into issues, don’t hesitate to use our tools like the SPF generator or the DMARC generator to create or troubleshoot your records.

Remember, email deliverability is an ongoing process. Regularly check your SPF, DKIM, and DMARC settings to keep your emails landing in the inbox. If you need more advanced features, check out our pricing page for options that fit your needs.

By following these steps, you’ll be well on your way to ensuring your emails reach your audience. Happy emailing!


Free Deliverability Scan

Check SPF, DKIM, DMARC and List-Unsubscribe for your domain in seconds.