SPF, DKIM, and DMARC: The Complete Setup Guide (2026)
Email authentication records are required for reliable deliverability. This guide covers exactly what SPF, DKIM, and DMARC do — and how to set them up on every major DNS provider and email platform.
Quick Setup Summary
- 1. SPF — Add a TXT record at
@with your email provider's include statement - 2. DKIM — Generate a key in your email provider's admin panel, add the TXT record they provide
- 3. DMARC — Add a TXT record at
_dmarcstarting withp=none - 4. Verify — Check with MXToolbox.com or mail-tester.com (wait 15–48 hours for propagation)
Why Email Authentication Matters in 2026
Since February 2024, Google and Yahoo require SPF, DKIM, and DMARC for senders over 5,000 emails/day, and Microsoft followed in late 2024. Even low-volume senders see far better inbox placement with authentication configured.
- SPF — Prevents spoofing: specifies which servers are authorized to send from your domain
- DKIM — Prevents tampering: cryptographically signs each email so receivers verify it arrived unmodified
- DMARC — Enforces policy: tells ISPs what to do when email fails SPF or DKIM, and sends daily reports
SPF (Sender Policy Framework)
What SPF Does
When Gmail receives an email claiming to be from your domain, it performs a DNS lookup to find your SPF record. If the sending server's IP is on your authorized list, the email passes SPF. If not, it fails — signaling spam or spoofing.
SPF Record Syntax
v=spf1 [mechanisms] [all]
include:domain.com — authorize another domain's sending IPs
ip4:1.2.3.4 — authorize a specific IP address
ip4:1.2.3.0/24 — authorize an IP range (CIDR)
~all — soft fail (recommended to start)
-all — hard fail (reject unauthorized senders)| Email Provider | SPF Record Value |
|---|---|
| Google Workspace | v=spf1 include:_spf.google.com ~all |
| Microsoft 365 / Outlook | v=spf1 include:spf.protection.outlook.com ~all |
| Zoho Mail | v=spf1 include:zoho.com ~all |
| SendGrid | v=spf1 include:sendgrid.net ~all |
| Mailchimp / Mandrill | v=spf1 include:servers.mcsv.net ~all |
| Amazon SES | v=spf1 include:amazonses.com ~all |
| Custom SMTP (own server) | v=spf1 ip4:YOUR.IP.ADDRESS ~all |
| Google Workspace + SendGrid | v=spf1 include:_spf.google.com include:sendgrid.net ~all |
SPF limit: Maximum 10 DNS lookups per check. Each include: counts as one. Use MXToolbox's SPF checker to count yours if you use many services.
Start Landing in the Inbox Today
Join 340+ companies using MailPilot to warm up their email accounts. 14-day free trial, no credit card required.
DKIM (DomainKeys Identified Mail)
What DKIM Does
Your mail server signs every outbound email with a private key. The matching public key lives in your DNS. When Gmail receives your email, it fetches your public key and verifies the signature. DKIM survives email forwarding (unlike SPF), making it the more reliable authentication method.
DKIM Setup by Provider
Google Workspace
- Google Admin console → Apps → Google Workspace → Gmail → Authenticate email
- Select your domain → click Generate new record
- Copy the TXT record (Name:
google._domainkey.yourdomain.com) and add it to your DNS - Wait for propagation, then return and click Start authentication
Microsoft 365
- Microsoft 365 Defender → Email & collaboration → Policies & rules → Threat policies → DKIM
- Select your domain → click Enable
- Add the two CNAME records Microsoft provides:
selector1._domainkeyandselector2._domainkey
DKIM Record Example
DMARC (Domain-based Message Authentication, Reporting, and Conformance)
What DMARC Does
DMARC adds policy enforcement on top of SPF and DKIM. It tells ISPs: "If an email from my domain fails SPF and DKIM alignment, do this." It also enables daily aggregate reports from major ISPs showing who is sending email from your domain and whether they're passing authentication.
DMARC requires alignment — the domain in the From: header must match the domain that passed SPF or DKIM.
DMARC DNS Record
- Name/Host:
_dmarc(resolves to_dmarc.yourdomain.com) - Type: TXT
DMARC Policy Progression — Never Skip Stages
Stage 1 — Monitor (p=none)
Weeks 1–4No impact on delivery. You receive daily XML reports. Review them to confirm all legitimate senders (Google Workspace, Mailchimp, etc.) pass SPF/DKIM before advancing.
Stage 2 — Quarantine 10%
Weeks 4–8Applies quarantine policy to 10% of failing emails. Gradually increase pct: 10 → 25 → 50 → 100 over 2–4 weeks.
Stage 3 — Quarantine 100%
Weeks 8–12All failing emails go to spam. Monitor reports carefully for 2+ weeks before advancing to p=reject.
Stage 4 — Reject (p=reject)
Week 12+Failing emails are rejected entirely. Only advance here after clean reports at p=quarantine. This also enables BIMI (logo in Gmail).
Skip the Manual DMARC Report Reviews
MailPilot watches SPF, DKIM, and DMARC for you and warms up across 8,400+ real mailboxes. 14-day free trial, no credit card.
Where to Add DNS Records: Provider Guide
Cloudflare
- Dashboard → your domain → DNS → Records → Add record
- SPF: Type=TXT, Name=@, Content=your SPF value
- DMARC: Type=TXT, Name=_dmarc, Content=your DMARC value
- DKIM: Type=TXT, Name=
selector._domainkey, Content=DKIM value - Set Proxy status to DNS only (gray cloud) for all mail records
- Propagation: 1–5 minutes
GoDaddy
- My Products → Domains → your domain → DNS → ADD
- SPF: Type=TXT, Name=@, Value=SPF record, TTL=1 hour
- DMARC: Type=TXT, Name=_dmarc, Value=DMARC record
- DKIM: Type=TXT, Name=
selector._domainkey, Value=DKIM value - Propagation: 1–2 hours
Namecheap
- Domain List → Manage → Advanced DNS → ADD NEW RECORD
- SPF: Type=TXT Record, Host=@, Value=SPF record
- DMARC: Type=TXT Record, Host=_dmarc, Value=DMARC record
- DKIM: Type=TXT Record, Host=
selector._domainkey, Value=DKIM value - Propagation: 30 min to 2 hours
Google Domains / Squarespace Domains
- domains.squarespace.com → your domain → DNS → Custom records → Create new record
- SPF: Type=TXT, Subdomain=(leave blank), Data=SPF record
- DMARC: Type=TXT, Subdomain=_dmarc, Data=DMARC record
- Propagation: ~15 minutes
Email Provider Quick Reference
| Provider | SPF Record | DKIM Setup Location |
|---|---|---|
| Google Workspace | v=spf1 include:_spf.google.com ~all | Admin console → Apps → Google Workspace → Gmail → Authenticate email → Generate DKIM key |
| Microsoft 365 | v=spf1 include:spf.protection.outlook.com ~all | M365 Defender → Email & collaboration → Policies → DKIM → Enable |
| Zoho Mail | v=spf1 include:zoho.com ~all | Zoho Admin → Domains → Email Authentication → DKIM → Add Selector |
| Custom SMTP | v=spf1 ip4:YOUR.SERVER.IP ~all | Generate via your mail server (Postfix/Exim) or hosting provider |
How to Verify Your Setup
Wait 15–48 hours after adding records, then verify with these tools:
- MXToolbox.com — SPF Lookup, DKIM Lookup, DMARC Lookup — green checkmark = valid
- mail-tester.com — Send a real email, get a 1–10 score with specific fixes (aim for 8+)
- Google Postmaster Tools — postmaster.google.com — shows domain reputation and authentication pass rates with Gmail
- dnschecker.org — Verify global propagation across multiple DNS servers worldwide
- MailPilot — Continuous automated monitoring with alerts when any authentication record breaks
Troubleshooting Common Errors
"Too many DNS lookups" (SPF PermError)
SPF allows max 10 DNS lookups. Each include:counts as one. Fix: use dmarcian's SPF Surveyor to count your lookups, then merge or flatten redundant includes using an SPF flattening service.
"Multiple SPF records found"
Delete one and combine into a single record: merge v=spf1 include:_spf.google.com ~all and v=spf1 include:servers.mcsv.net ~all into v=spf1 include:_spf.google.com include:servers.mcsv.net ~all.
"No DKIM record found"
You're likely using the wrong selector. For Google Workspace: google. For Microsoft 365:selector1 and selector2. Confirm the exact selector in your email provider's admin panel.
"DMARC policy not found"
The record must be at _dmarc.yourdomain.com. In your DNS provider, set the Name/Host to just _dmarc — the provider appends your domain automatically.
Passes SPF/DKIM but still lands in spam
Authentication is necessary but not sufficient. Other signals: new domain with no sending history (requires warmup), spam complaint rate above 0.1%, high bounce rate, or spammy content patterns. See our email warmup guide for the full picture.
BIMI: Show Your Logo in Gmail
BIMI displays your company logo in Gmail next to your sender name. Requirements:
- DMARC at
p=quarantineorp=reject - A Verified Mark Certificate (VMC) from Entrust or DigiCert (~$1,500/year for Gmail)
- SVG logo in BIMI-compliant format (square, solid colors, trademarked)
- BIMI TXT record at
default._bimi.yourdomain.com:v=BIMI1; l=https://yourdomain.com/bimi.svg; a=https://yourdomain.com/bimi.pem
Focus on SPF, DKIM, and DMARC first. Once you reach p=reject and stable reputation, BIMI improves open rates by 8–12% through brand recognition.
MailPilot Monitors Your Authentication Automatically
Get alerts when SPF, DKIM, or DMARC issues are detected. 8,400+ real mailboxes for warmup. 14-day free trial, no credit card.
Related Guides
Related guides
SPF/DKIM/DMARC FAQ
Yes. SPF, DKIM, and DMARC work together as a system. SPF specifies which servers can send for your domain. DKIM cryptographically signs each email. DMARC tells ISPs what to do when SPF or DKIM fail, and sends you daily reports. All three are required by Google and Yahoo for bulk senders since 2024.