Ahosting Logo
Knowledge Base

Understanding SPF, DKIM, and DMARC Records

SPF, DKIM, and DMARC are email authentication methods that help prevent spoofing and improve email deliverability. Understanding these is crucial for ensuring your emails reach recipients.

Why Email Authentication Matters

  • Prevents others from sending emails pretending to be you
  • Improves deliverability (fewer emails go to spam)
  • Protects your domain reputation
  • Required by many email providers (Gmail, Microsoft, etc.)

SPF (Sender Policy Framework)

SPF tells receiving servers which mail servers are authorized to send email for your domain.

How SPF Works

  1. You publish a DNS TXT record listing authorized servers
  2. Receiving server checks if sending server is in the list
  3. If not authorized, email may be rejected or marked as spam

Example SPF Record

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

SPF Components

Tag Meaning
v=spf1 SPF version (required)
+a Allow domain A record IP
+mx Allow MX servers
include: Include another domain SPF
~all Soft fail others (recommended)
-all Hard fail others (strict)

DKIM (DomainKeys Identified Mail)

DKIM adds a digital signature to emails, proving they have not been modified in transit.

How DKIM Works

  1. Your server signs outgoing emails with a private key
  2. Public key is published in DNS
  3. Receiving server verifies signature with public key
  4. If signature is valid, email is authenticated

Enabling DKIM in cPanel

  1. Go to Email > Email Deliverability
  2. Find your domain
  3. Click Manage
  4. DKIM should show as enabled
  5. If not, click Install Record

DMARC (Domain-based Message Authentication)

DMARC tells receiving servers what to do when SPF or DKIM fails, and provides reporting.

Example DMARC Record

v=DMARC1; p=quarantine; rua=mailto:[email protected]; pct=100

DMARC Policies

Policy Action
p=none Monitor only (no action)
p=quarantine Send to spam folder
p=reject Block the email

Checking Email Deliverability in cPanel

  1. Go to Email > Email Deliverability
  2. View status for each domain
  3. Green checkmarks = properly configured
  4. Warnings indicate issues to fix
  5. Click Repair to auto-fix issues

Testing Your Records

Use these free tools to verify your email authentication:

Recommended Setup

  1. Ensure SPF record exists and includes your mail server
  2. Enable DKIM in cPanel
  3. Add DMARC record starting with p=none
  4. Monitor DMARC reports
  5. Gradually move to p=quarantine, then p=reject