HomeBlogHow to Set Up SPF Records in cPanel: Complete Step-by-Step Guide
GuidesSPFcPanelDNSEmail AuthenticationTutorial

How to Set Up SPF Records in cPanel: Complete Step-by-Step Guide

Learn how to configure SPF records in cPanel DNS Zone Editor. Includes screenshots, troubleshooting, and best practices for email authentication.

MailSentinel Team

Author

January 15, 20245 min read

How to Set Up SPF Records in cPanel: Complete Step-by-Step Guide

Setting up SPF (Sender Policy Framework) records is essential for email authentication and deliverability. If you're using cPanel for your hosting and DNS management, this guide will walk you through the entire process.

Why SPF Records Matter

SPF records tell receiving mail servers which IP addresses and servers are authorized to send email for your domain. Without proper SPF configuration:

  • Emails may be marked as spam
  • Deliverability rates drop significantly
  • You fail Google and Yahoo's 2024 requirements
  • DMARC won't work properly

Prerequisites

Before you begin, make sure you have:

  • cPanel access for your domain
  • Admin or reseller access (to modify DNS)
  • Your SPF record ready to publish
  • List of all services sending email from your domain

Step 1: Access cPanel DNS Zone Editor

  1. Log in to your cPanel account
  2. Scroll down to the DOMAINS section
  3. Click Zone Editor (or Advanced DNS Zone Editor)
  4. Select your domain from the dropdown menu

You'll now see all your DNS records for the selected domain.

Step 2: Check for Existing SPF Record

Important: Only ONE SPF record is allowed per domain. Multiple SPF records cause validation errors.

Before adding a new record, check if one already exists:

Look for:

  • TXT records at the root domain
  • Records containing v=spf1 in the value
  • Records with Name field showing your domain

If an SPF record exists:

  • You need to edit it, not create a new one
  • Click the Edit button next to the existing record

Step 3: Build Your SPF Record

Common SPF Record Examples

Google Workspace Only:

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

Microsoft 365 Only:

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

Multiple Services:

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

Understanding SPF Components

  • v=spf1 - SPF version (always required)
  • include: - Include another domain's SPF record
  • -all - Fail (reject) all other senders (recommended)
  • ~all - SoftFail (accept but mark) - for testing only
  • +all - Pass all - NEVER USE THIS

Step 4: Add SPF Record in cPanel

Option A: Adding New SPF Record

  1. Scroll down to the Add Record section
  2. Fill in the fields:
FieldValue
Name@ or your domain name (e.g., example.com)
TTL3600 (1 hour) or leave default
TypeTXT
TXT DataYour complete SPF record

Example:

Name: @
TTL: 3600
Type: TXT
TXT Data: v=spf1 include:_spf.google.com -all
  1. Click Add Record

Option B: Editing Existing SPF Record

  1. Find your existing SPF TXT record in the records list
  2. Click Edit next to the record
  3. Update the TXT Data field with your new SPF record
  4. Click Save Record

Step 5: Verify Your SPF Record

In cPanel

  1. Return to Zone Editor
  2. Verify your SPF record appears in the list
  3. Check that Name field shows @ or your domain
  4. Verify TXT Data contains your SPF record

Using Online Tools

MXToolbox SPF Checker:

  1. Go to https://mxtoolbox.com/spf.aspx
  2. Enter your domain
  3. Click SPF Record Lookup
  4. Verify record is detected

MailSentinel:

  1. Add your domain to MailSentinel
  2. Run DNS scan
  3. Verify SPF record is detected
  4. Check validation status

Common Issues and Solutions

Issue 1: SPF Record Not Detected

Symptoms:

  • SPF checkers don't find your record
  • MailSentinel shows "No SPF record"

Solutions:

  1. Wait for DNS Propagation

    • DNS changes can take 15-60 minutes
    • Some DNS checkers cache results
    • Try multiple DNS checkers
  2. Verify Record Location

    • Name field should be @ or your domain
    • Not on a subdomain
    • Check exact domain name matches
  3. Check Record Format

    • Ensure v=spf1 is present
    • No extra spaces or line breaks
    • Quotes may be added automatically by cPanel

Issue 2: Multiple SPF Records

Symptoms:

  • "Multiple SPF records" error
  • SPF validation fails

Solutions:

  1. Find all SPF records:

    • Search for all TXT records with v=spf1
    • Check both root and subdomains
  2. Merge records:

    • Combine all includes into one record
    • Keep only one SPF record
  3. Delete duplicates:

    • Remove extra SPF records
    • Keep only the merged record

Issue 3: Too Many DNS Lookups

Symptoms:

  • "Too many DNS lookups" error
  • SPF validation fails

Solutions:

  1. Count Your Lookups:

    • Each include: counts as 1+ lookups
    • Maximum is 10 lookups total
    • Use SPF checker to see breakdown
  2. Reduce Lookups:

    • Remove unused includes
    • Use subdomains for some services
    • Flatten includes to IP ranges (if possible)

Best Practices

1. Start with Monitoring

Begin with ~all (softfail) to monitor:

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

Then move to -all after verifying all sources:

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

2. Document Your Sources

Keep a list of:

  • All sending services
  • Their SPF includes
  • IP addresses used
  • When services were added/removed

3. Regular Audits

Review SPF records quarterly:

  • Remove unused services
  • Add new services
  • Check lookup count
  • Verify alignment

4. Test Before Changes

  • Use SPF testing tools
  • Send test emails
  • Check DMARC reports
  • Monitor for failures

Next Steps

After setting up SPF in cPanel:

  1. Configure DKIM - Set up DKIM signing
  2. Set Up DMARC - Configure DMARC policy
  3. Monitor SPF - Track validation status
  4. Set Up Alerts - Get notified of issues

Additional Resources

Need help? Contact MailSentinel Support or check our documentation.

Protect your domain with MailSentinel

Monitor DMARC, SPF, and DKIM in real-time. Get instant alerts when issues arise and improve your email deliverability.