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
- Log in to your cPanel account
- Scroll down to DOMAINS section
- Click Zone Editor (or Advanced DNS Zone Editor)
- 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
- Scroll down to Add Record section
- Fill in the fields:
| Field | Value |
|---|---|
| Name | @ or your domain name (e.g., example.com) |
| TTL | 3600 (1 hour) or leave default |
| Type | TXT |
| TXT Data | Your 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
- Click Add Record
Option B: Editing Existing SPF Record
- Find your existing SPF TXT record in the records list
- Click Edit next to the record
- Update the TXT Data field with your new SPF record
- Click Save Record
Step 4: Verify SPF Record
In cPanel
- Return to Zone Editor
- Verify your SPF record appears in the list
- Check that Name field shows
@or your domain
Using MailSentinel
- Add your domain to MailSentinel
- Run DNS scan
- Verify SPF record is detected
- Check validation status
Using Online Tools
- MXToolbox: https://mxtoolbox.com/spf.aspx
- SPF Validator: https://www.dmarcanalyzer.com/spf-check/
- DNS Checker: https://dnschecker.org/
Common SPF Record Examples
Google Workspace Only
v=spf1 include:_spf.google.com -allcPanel 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 -allMultiple Services
v=spf1 include:_spf.google.com include:sendgrid.net include:servers.mcsv.net -allTroubleshooting cPanel SPF Issues
Issue 1: SPF Record Not Detected
Symptoms:
- SPF checkers don't find your record
- MailSentinel shows "No SPF record"
Solutions:
-
Verify Record Location
- Name field should be
@or your domain - Not on a subdomain
- Check exact domain name matches
- Name field should be
-
Check Record Format
- Ensure
v=spf1is present - No extra spaces or line breaks
- Quotes may be added automatically by cPanel
- Ensure
-
Wait for Propagation
- DNS changes can take 15-60 minutes
- Some DNS checkers cache results
- Try multiple DNS checkers
-
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:
-
Find All SPF Records:
- Search for all TXT records
- Look for records with
v=spf1 - Check both root and subdomains
-
Merge Records:
- Combine all includes into one record
- Keep only one SPF record
-
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:
-
Check Permissions:
- Ensure you have DNS modification rights
- Contact hosting provider if needed
-
Verify Format:
- Check for special characters
- Ensure proper quoting
- Try without quotes (cPanel may add them)
-
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:
-
Count Your Lookups:
- Each
include:counts as 1+ lookups - Maximum is 10 lookups total
- Use SPF checker to see breakdown
- Each
-
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:
- Go to Advanced DNS Zone Editor
- Select your domain
- Edit DNS zone file directly
- Add SPF record in proper format
- Save changes
Warning: Only use if you're comfortable editing DNS zone files directly.
External DNS Management
If DNS is managed externally:
-
Identify DNS Provider:
- Check nameservers in cPanel
- Find where DNS is actually managed
-
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:
- Configure DKIM - Set up DKIM signing
- Set Up DMARC - Configure DMARC policy
- Monitor SPF - Track validation status
- Set Up Alerts - Get notified of issues
Additional Resources
- cPanel DNS Documentation - Official cPanel documentation
- SPF Configuration Guide - Complete SPF setup guide
- cPanel Support - cPanel support resources