How to Add an SPF Record in cPanel

Step-by-step guide to adding and editing SPF records in cPanel. Covers the Zone Editor, common hosting configurations, and fixing auto-generated SPF records.

cPanel is the most widely used hosting control panel, and it's where millions of domains manage their DNS records. Adding an SPF record in cPanel is straightforward, but there's one complication you'll almost certainly run into: your hosting provider probably already created an SPF record for you automatically.

This guide covers the full process -- from finding the right DNS tool in cPanel, to dealing with auto-generated records, to building a proper SPF record that works with your hosting server and any third-party email services.

Which Hosting Providers Use cPanel?

If you're on shared or reseller hosting, there's a good chance your host runs cPanel. These are some of the most popular providers that include cPanel:

HostGator

All shared and reseller plans include cPanel.

Bluehost

cPanel is available on shared hosting plans, though the interface may be slightly customized.

SiteGround

Uses a custom interface called Site Tools on newer plans, but older plans still use cPanel.

A2 Hosting

Full cPanel access on shared, reseller, and VPS plans.

InMotion Hosting

cPanel included with shared and VPS hosting plans.

GreenGeeks

cPanel on all shared hosting plans.

If your host uses a different control panel (like Plesk, DirectAdmin, or a custom dashboard), the DNS management steps will differ. This guide is specifically for cPanel.

Finding the DNS Editor in cPanel

cPanel has gone through several interface versions, and the DNS management tool has changed names over the years. Here's how to find it:

Modern cPanel: Zone Editor

In current versions of cPanel, the tool is called Zone Editor. You'll find it under the Domains section of your cPanel dashboard. This is the tool you want.

Older cPanel: DNS Zone Editor or Simple/Advanced DNS Zone Editor

Older cPanel versions split DNS management into a "Simple DNS Zone Editor" and an "Advanced DNS Zone Editor." If you see these, use the Advanced DNS Zone Editor -- it gives you full control over record types and values.

WHM (for VPS/Dedicated Servers)

If you manage your own server with WHM (Web Host Manager), DNS zone management is under DNS Functions > Edit DNS Zone. The process is the same, but you access it from WHM instead of cPanel.

The Auto-Generated SPF Record Problem

Here's the detail that catches most people off guard: many cPanel hosting providers automatically create an SPF record for your domain. This record typically authorizes the server's IP address and sometimes the server's hostname.

A typical auto-generated record looks like:

v=spf1 +a +mx +ip4:192.0.2.1 ~all

This record says: "Allow the server's A record IP, the MX server, and the specific IP 192.0.2.1 to send email." It's fine if your hosting server is your only email sender, but it causes problems when you add third-party services.

Don't create a second SPF record

If your host already created an SPF record, you need to edit it -- not add a new one alongside it. Having two TXT records starting with v=spf1 causes a permerror, and all SPF checks will fail for your domain.

How to Check for an Existing SPF Record

Before adding anything, check what's already there:

  1. Open the Zone Editor in cPanel
  2. Click Manage next to your domain
  3. Look for any TXT records with values starting with v=spf1

You can also use SPF Record Check to look up your domain externally and see exactly what SPF record is currently published.

Step-by-Step: Adding or Editing an SPF Record in cPanel

1

Log in to cPanel

Access your cPanel through your hosting provider's dashboard, or go directly to yourdomain.com:2083 or yourdomain.com/cpanel. Your host may also provide a direct login link.

2

Open Zone Editor

In the cPanel dashboard, scroll to the Domains section and click Zone Editor. If you have multiple domains, you'll see them listed here.

3

Click Manage next to your domain

Find the domain you want to configure and click Manage. This opens the full list of DNS records for that domain.

4

Check for an existing SPF record

Scroll through the records or use the filter to find TXT records. Look for any record with a value starting with v=spf1. If one exists, you'll need to edit it. If none exists, you'll add a new one.

5

Edit existing or add new TXT record

If editing an existing record: Click the Edit button next to the SPF TXT record. Update the Record (value) field with your new SPF record.

If adding a new record: Click Add Record and choose Add a TXT Record. Set these fields:

  • Name: Your domain name (e.g., yourdomain.com.) -- cPanel usually fills this in automatically with a trailing dot
  • TTL: 14400 (4 hours, the cPanel default) or 3600 (1 hour)
  • Record (Value): Your SPF record (e.g., v=spf1 include:_spf.google.com -all)
6

Save the record

Click Save Record. The change takes effect in DNS immediately on the server side, though full propagation across the internet can take a few minutes to 48 hours.

7

Verify the record

Use SPF Record Check to confirm your record is live, properly formatted, and under the 10 DNS lookup limit.

Merging the Auto-Generated Record with Third-Party Services

The most common scenario is needing to combine your hosting server's sending capabilities with a third-party email provider like Google Workspace, Microsoft 365, or a transactional email service.

The key is to keep the server IP from the auto-generated record (if your server still sends email) and add the new provider's include.

Before (auto-generated by host)

v=spf1 +a +mx +ip4:192.0.2.1 ~all

After (merged with Google Workspace)

v=spf1 +a +mx +ip4:192.0.2.1 include:_spf.google.com ~all

Do you still need the server IP?

If your website sends email through PHP's mail() function, contact forms, or WordPress notification emails, keep the server's IP or +a mechanism. If all your email goes through an external service like Google Workspace, you can safely remove the server-specific mechanisms and simplify your record.

Check your email deliverability

Make sure your SPF, DKIM, and DMARC records are all working together to protect your domain.

Start Monitoring

Example SPF Records for cPanel Hosting

Here are common configurations for domains hosted on cPanel servers:

cPanel Server Only (No External Email)

If your server handles all email (web hosting email, PHP mail, etc.):

v=spf1 +a +mx ~all

This authorizes the server's A record and MX record. Simple and effective for basic setups.

cPanel Server + Google Workspace

The most common combination -- your website is on a cPanel host, but email is through Google Workspace:

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

If your site also sends email from the server (contact forms, WordPress notifications via the server's mail function):

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

cPanel Server + Microsoft 365

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

Include +a only if the server itself also sends email.

cPanel Server + SendGrid

v=spf1 +a +mx include:sendgrid.net -all

Common for sites that use their hosting email for general correspondence and SendGrid for transactional messages.

cPanel Server + Google Workspace + SendGrid

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

If the server doesn't send email directly (all email goes through Google or SendGrid), you don't need the +a or +mx mechanisms.

cPanel Server + Google Workspace + Mailchimp

v=spf1 +a include:_spf.google.com include:servers.mcsv.net -all
SetupSPF RecordApprox. Lookups
cPanel server onlyv=spf1 +a +mx ~all2
Google Workspace onlyv=spf1 include:_spf.google.com -all3
Server + Google Workspacev=spf1 +a include:_spf.google.com -all4
Server + Google + SendGridv=spf1 +a include:_spf.google.com include:sendgrid.net -all5
Server + Microsoft 365v=spf1 +a include:spf.protection.outlook.com -all3
Server + Google + Mailchimpv=spf1 +a include:_spf.google.com include:servers.mcsv.net -all5

Common cPanel SPF Mistakes

Leaving Two SPF Records Active

This is the number one mistake. You add a new SPF record for Google Workspace without removing or editing the auto-generated one. Now you have two v=spf1 records, and all SPF checks fail with permerror.

Fix: Always edit the existing record. Never add a second one.

Removing the Server IP When You Still Need It

If your WordPress site sends email through PHP mail() (password resets, contact forms, WooCommerce order notifications), removing the server's IP or +a mechanism from your SPF record means those emails will fail SPF.

Fix: Keep +a or the specific ip4: address in your record if the server sends any email at all. Alternatively, configure WordPress to send through an SMTP plugin using Google Workspace or a transactional service -- this is the better long-term approach.

Using the Old DNS Zone Editor Instead of Zone Editor

Older cPanel versions had both a "Simple" and "Advanced" DNS Zone Editor. If you accidentally use the Simple editor, you may not be able to edit TXT record values properly. Always use the Advanced or modern Zone Editor.

Not Checking Propagation

After saving a record in cPanel, it's tempting to assume it's live. But DNS changes need to propagate. Wait a few minutes, then verify with SPF Record Check before calling it done.

SPF for Subdomains in cPanel

If you send email from a subdomain (like shop.yourdomain.com or support.yourdomain.com), add a separate TXT record for that subdomain in the Zone Editor.

Set the Name field to the subdomain (e.g., shop.yourdomain.com.) and the Record value to the SPF record for that subdomain.

Each subdomain gets its own SPF record with its own 10-lookup budget, which is useful when your root domain's record is approaching the limit.

WordPress-Specific Considerations

If your cPanel-hosted site runs WordPress, keep these in mind:

  • Default WordPress email uses PHP's mail() function, which sends from the server IP. Your SPF record needs +a or the server's IP to cover this.
  • SMTP plugins (like WP Mail SMTP, Post SMTP, or FluentSMTP) send through an external service instead. If you've configured an SMTP plugin to send through Google Workspace or SendGrid, you need that service's SPF include, but you may not need the server IP anymore.
  • WooCommerce, form plugins, and membership plugins all send email. Make sure whatever method they use is covered by your SPF record.

Best practice for WordPress on cPanel

Configure an SMTP plugin to route all WordPress email through your primary email provider (like Google Workspace) or a transactional service (like SendGrid). This gives you better deliverability and simplifies your SPF record.

Complete Your Email Authentication

SPF is one of three email authentication protocols that work together. Once your SPF record is live in cPanel, the next steps are:

  • Set up DKIM -- DKIM adds a cryptographic signature proving your emails haven't been altered in transit. Use DKIM Creator to generate your DKIM keys. Add the resulting TXT record in the same cPanel Zone Editor.
  • Set up DMARC -- DMARC ties SPF and DKIM together and tells receiving servers what to do when authentication fails. Use DMARC Creator to build your DMARC policy.

All three records are TXT records added through the same Zone Editor in cPanel.

Monitor Your New SPF Record

You've created your SPF record — now make sure it keeps working. The Email Deliverability Suite watches your SPF, DKIM, DMARC, and MX records daily and alerts you when something breaks.

Never miss an SPF issue

Monitor your SPF, DKIM, DMARC and MX records daily. Get alerts when something breaks.

Start Monitoring