If your website and email are hosted on a cPanel shared hosting account, this guide will walk you through setting up SPF, DKIM, and DMARC. The good news: cPanel often has built-in tools that make this easier than you’d expect.
This guide is for small businesses and website owners using cPanel-based shared hosting (HostGator, Bluehost, SiteGround, A2 Hosting, GoDaddy, Namecheap, etc.) where cPanel handles both web hosting and email.
Step 1: Configure SPF
Most cPanel hosting providers automatically create a basic SPF record when you add a domain. However, you should verify it exists and is correct.
Option A: Via cPanel’s Email Deliverability Tool
- Log in to cPanel
- Go to Email → Email Deliverability
- Find your domain and click “Manage”
- The SPF section will show your current record and suggest fixes
- Click “Install the suggested record” if prompted
Option B: Manual DNS Entry
If you manage DNS separately (e.g., Cloudflare, Route 53), add this TXT record:
Host/Name:
@Value:
v=spf1 +a +mx +ip4:YOUR.SERVER.IP -allTTL:3600
If you also use external email services (Mailchimp, SendGrid, etc.), add their includes too:
Step 2: Configure DKIM
cPanel has built-in DKIM support that generates and manages keys automatically.
Enable DKIM via Email Deliverability
- In cPanel, go to Email → Email Deliverability
- Find your domain and click “Manage”
- In the DKIM section, click “Install the suggested record”
- cPanel will generate a DKIM key pair and publish the DNS record automatically (if DNS is managed by cPanel)
default._domainkey).
Manual DKIM (If Email Deliverability Isn’t Available)
Older cPanel versions may not have the Email Deliverability tool. In that case:
- Go to Email → Authentication (or Email → DKIM)
- Click “Enable” for DKIM
- If using external DNS, copy the record and add it at your DNS provider
Step 3: Configure DMARC
cPanel doesn’t have a built-in DMARC tool, so you’ll add this DNS record manually.
Via cPanel Zone Editor
- In cPanel, go to Domains → Zone Editor
- Find your domain and click “Manage”
- Click “Add Record” → “Add TXT Record”
- Enter:
- Name:
_dmarc.yourdomain.com.(with trailing dot, or just_dmarcdepending on your cPanel version) - TTL: 3600
- Type: TXT
- Record:
v=DMARC1; p=none; rua=mailto:your-selector@dmarccloud.com; adkim=r; aspf=r
- Name:
- Click “Save Record”
Use our DMARC Record Generator to build the exact record value.
Verify Your Setup
- Use our Domain Checker to verify SPF, DKIM, and DMARC are published
- Send a test email from your cPanel-hosted email to an external Gmail account
- In Gmail, view “Show original” and confirm SPF, DKIM, and DMARC all pass
- Check cPanel’s Email Deliverability tool — all three indicators should show green
Common cPanel Issues
If your domain’s nameservers point to the hosting provider, cPanel manages DNS and can auto-install records. If nameservers point elsewhere (Cloudflare, GoDaddy, etc.), you must add SPF, DKIM, and DMARC records manually at your DNS provider.
This usually means DNS records don’t match what cPanel expects. Click “Manage” to see the suggested records and install them. If using external DNS, copy the suggested values to your DNS provider.
Some DNS providers don’t handle long TXT records well. cPanel typically generates 2048-bit DKIM keys. If your DNS provider truncates the value, try adding it as two separate quoted strings within a single TXT record, or contact your DNS provider for support.
Contact form plugins (WordPress, etc.) that use PHP’s
mail() function send from the server — which IS covered by your SPF +a mechanism. If they’re failing, it’s usually because the From: address doesn’t match your domain (some forms use the visitor’s email address as the From: — configure the form to use your domain’s email instead).
On shared hosting, your server’s IP is shared with potentially hundreds of other accounts. If another account sends spam, your IP reputation suffers. SPF, DKIM, and DMARC help distinguish your legitimate email. Consider a dedicated IP if deliverability is critical.
Using cPanel Email with External DNS (Cloudflare, etc.)
If your DNS is managed by Cloudflare or another external provider, you need to manually copy records from cPanel:
- In cPanel Email Deliverability, view the suggested records for SPF and DKIM
- Copy each record’s name and value
- Log into your DNS provider and add them as TXT records
- Add the DMARC record manually (not shown in cPanel)
- Return to cPanel Email Deliverability and click “Repair” to verify the records resolve correctly
Summary Checklist
- ☐ SPF record published (via Email Deliverability or manually)
- ☐ Only one SPF record per domain
- ☐ DKIM enabled in cPanel and DNS record published
- ☐ DMARC TXT record added at
_dmarcwithp=none - ☐ cPanel Email Deliverability shows all green
- ☐ Test email confirms SPF PASS, DKIM PASS, DMARC PASS
- ☐ External sending services (if any) included in SPF
For more on the implementation process, see How to Implement DMARC. For SPF details, see the SPF Record Syntax Guide.