Setting Up SPF Records in cPanel

Complete guide to configuring SPF records in cPanel DNS. Includes step-by-step instructions for cPanel's DNS Zone Editor.

Setting Up SPF Records in cPanel

cPanel is a popular web hosting control panel. This guide shows you how to configure SPF records using cPanel's DNS Zone Editor.

Prerequisites

  • cPanel access for your domain
  • Admin or reseller access (to modify DNS)
  • Your SPF record ready to publish

Step 1: Access cPanel DNS Zone Editor

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

Step 2: Check for Existing SPF Record

Before adding a new record, check for existing SPF records:

Look for:

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

If an SPF record exists:

  • You need to edit it, not create a new one
  • Only ONE SPF record is allowed per domain
  • Multiple SPF records cause validation errors

Step 3: Add or Edit SPF Record

Option A: Adding New SPF Record

  1. Scroll down to 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 (e.g., v=spf1 include:_spf.google.com -all)

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 4: Verify 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

Using MailSentinel

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

Using Online Tools

Common SPF Record Examples

Google Workspace Only

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

cPanel Configuration:

  • Name: @
  • Type: TXT
  • TTL: 3600
  • TXT Data: 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

Troubleshooting cPanel SPF Issues

Issue 1: SPF Record Not Detected

Symptoms:

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

Solutions:

  1. Verify Record Location

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

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

    • DNS changes can take 15-60 minutes
    • Some DNS checkers cache results
    • Try multiple DNS checkers
  4. Check cPanel DNS Settings

    • Ensure DNS is managed by cPanel (not external)
    • Check nameservers point to cPanel
    • Verify domain is active

Issue 2: Multiple SPF Records

Symptoms:

  • "Multiple SPF records" error
  • SPF validation fails

Solutions:

  1. Find All SPF Records:

    • Search for all TXT records
    • Look for 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
    • Click Delete next to duplicate records

Issue 3: Record Not Saving

Symptoms:

  • Changes don't persist
  • Record disappears after saving

Solutions:

  1. Check Permissions:

    • Ensure you have DNS modification rights
    • Contact hosting provider if needed
  2. Verify Format:

    • Check for special characters
    • Ensure proper quoting
    • Try without quotes (cPanel may add them)
  3. Clear Cache:

    • Clear browser cache
    • Try different browser
    • Log out and back in

Issue 4: DNS Lookup Limit Exceeded

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)

cPanel-Specific Features

DNS Zone Editor vs Advanced DNS Zone Editor

Standard Zone Editor:

  • Easier to use
  • Good for basic records
  • Recommended for most users

Advanced DNS Zone Editor:

  • More control
  • Direct DNS file editing
  • For advanced users only

Recommendation: Use standard Zone Editor unless you need advanced features.

TTL Settings

Default TTL:

  • cPanel usually defaults to 3600 seconds (1 hour)
  • Can be changed per record
  • Lower TTL = faster changes propagate

Recommendation:

  • Use 3600 for most cases
  • Lower to 300 before making changes
  • Increase back to 3600 after changes

Record Management

Best Practices:

  • Keep records organized
  • Document why each record exists
  • Regular cleanup of unused records
  • Use comments if available

Best Practices for cPanel SPF

1. Use Root Domain

  • Always add SPF at root domain (@)
  • Not on subdomains
  • Ensures proper validation

2. Single SPF Record

  • Only ONE SPF record per domain
  • Merge multiple records if needed
  • Delete duplicates immediately

3. Regular Audits

  • Review SPF records quarterly
  • Remove unused includes
  • Check lookup count
  • Verify all services still needed

4. Test Before Production

  • Use test subdomain first
  • Verify SPF validation
  • Check lookup count
  • Then apply to production

5. Monitor Changes

  • Use MailSentinel to monitor SPF
  • Set up alerts for changes
  • Track validation status
  • Review DMARC reports

Advanced cPanel SPF Configuration

Using Advanced DNS Zone Editor

For advanced users:

  1. Go to Advanced DNS Zone Editor
  2. Select your domain
  3. Edit DNS zone file directly
  4. Add SPF record in proper format
  5. Save changes

Warning: Only use if you're comfortable editing DNS zone files directly.

External DNS Management

If DNS is managed externally:

  1. Identify DNS Provider:

    • Check nameservers in cPanel
    • Find where DNS is actually managed
  2. Add SPF at DNS Provider:

    • Not in cPanel
    • Use provider's DNS interface
    • Follow provider's instructions

Common cPanel Hosting Scenarios

Shared Hosting

Typical Setup:

  • cPanel manages DNS
  • Use Zone Editor
  • Follow standard process

VPS/Dedicated Server

Typical Setup:

  • May use cPanel or external DNS
  • Check nameservers first
  • Follow appropriate guide

Reseller Account

Permissions:

  • May need to contact main account holder
  • Or have DNS modification rights
  • Check with hosting provider

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