SPF, DKIM & DMARC Setup Guide 2026 - Step-by-Step for Cold Email | BounceZero
BlogDeliverability

SPF, DKIM & DMARC Setup Guide 2026
Step-by-Step for Cold Email

Google and Microsoft made all three mandatory in 2024. If your domain is missing any one of them, your cold emails are being rejected or spam-filtered before your subject line is ever seen. This guide sets them up correctly.

By BounceZero Team |July 2026 |12 min read

Quick authentication check

Run these commands to instantly check your domain. Replace yourdomain.com with your actual domain:

# Check SPF
dig TXT yourdomain.com | grep spf

# Check DMARC
dig TXT _dmarc.yourdomain.com

# Check DKIM (replace 'selector' with your actual DKIM selector)
dig TXT selector._domainkey.yourdomain.com

What SPF, DKIM, and DMARC Actually Do

SPF

Sender Policy Framework

A DNS TXT record that lists which mail servers are authorised to send email from your domain. When a receiving server gets an email claiming to be from yourdomain.com, it checks your SPF record. If the sending server IP is not listed, the email fails SPF.

DKIM

DomainKeys Identified Mail

Adds a cryptographic signature to every email. The receiving server fetches your public key from DNS and uses it to verify the signature. If the email was modified in transit, the signature fails. DKIM proves the email was genuinely sent by you and was not tampered with.

DMARC

Domain-based Message Auth

A policy record that tells receiving servers what to do when SPF or DKIM checks fail: monitor only (p=none), send to spam (p=quarantine), or reject outright (p=reject). Also enables DMARC reports - XML summaries of your sending activity sent to your monitoring email.

Step 1 - Set Up SPF

SPF is a single DNS TXT record added to your domain. It lists the IP addresses and mail services allowed to send from your domain. You should have exactly one SPF record - multiple SPF records cause failures.

SPF record format

# Basic SPF record (replace with your actual email provider)
v=spf1 include:_spf.google.com ~all

# If sending via multiple providers (e.g. Google + Mailgun):
v=spf1 include:_spf.google.com include:mailgun.org ~all

# Common provider includes:
# Google Workspace:    include:_spf.google.com
# Microsoft 365:       include:spf.protection.outlook.com
# Instantly/Smartlead: include:spf.instantlyai.com (if custom domain)
# SendGrid:            include:sendgrid.net
# Mailgun:             include:mailgun.org
# Amazon SES:          include:amazonses.com

SPF qualifiers explained

QualifierMeaningUse
+allPass - allow all sendersNever use
~allSoftFail - allow but markGood default
-allFail - reject unlisted sendersUse after confirming all senders are listed
?allNeutral - no policyAvoid - same as no record
SPF 10-lookup limit: SPF allows a maximum of 10 DNS lookups during evaluation. Each include: directive typically costs 1 lookup. If you have many sending services, you may hit the limit - use an SPF flattening service or consolidate to a single ESP.

Step 2 - Set Up DKIM

DKIM keys are generated by your email provider, not manually created. Go to your provider settings and find the DKIM setup section. They will give you a selector name and a public key to add to your DNS.

Google Workspace

Admin > Apps > Google Workspace > Gmail > Authenticate Email. Generate new record. Add the provided TXT record to DNS under: [selector]._domainkey.yourdomain.com

Microsoft 365

Admin Center > Settings > Domains > [your domain] > DNS records. Microsoft adds DKIM records automatically for M365 domains. Verify under: selector1._domainkey.yourdomain.com

Instantly.ai

Domain settings > Email Authentication > Generate DKIM. Add the TXT record provided to your DNS at: [selector]._domainkey.yourdomain.com

SendGrid

Settings > Sender Authentication > Domain Authentication. Follow the wizard. SendGrid generates two CNAME records (not TXT) for DKIM.

DKIM DNS record format

# Your DKIM record format in DNS:
# Type: TXT
# Name: [selector]._domainkey.yourdomain.com
# Value: v=DKIM1; k=rsa; p=[your-public-key]

# Example (key shortened):
# Type: TXT
# Name: google._domainkey.yourdomain.com
# Value: v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC...

Step 3 - Set Up DMARC

DMARC is a single TXT record added at _dmarc.yourdomain.com. Always start with p=none to collect reports first - never jump straight to p=reject.

DMARC rollout phases

Phase 1 - Monitor (Week 1-4)

p=none
v=DMARC1; p=none; rua=mailto:[email protected]

No emails are blocked. DMARC reports are collected and sent to your rua address. Analyse reports to find all sending sources before enforcing anything.

Phase 2 - Quarantine (Week 5-8)

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

Failing emails are sent to spam for 25% of traffic (pct=25). Increase pct gradually as you confirm no legitimate email is failing. Monitor reports closely.

Phase 3 - Reject (Week 9+)

p=reject
v=DMARC1; p=reject; rua=mailto:[email protected]

Failing emails are rejected outright. Only move here when you are confident all legitimate sending sources pass SPF and DKIM.

DMARC tag reference

TagPurposeRecommended value
pPolicy for failing emailsnone > quarantine > reject
ruaAggregate report emailmailto:[email protected]
pct% of mail policy applies to25 > 50 > 100 during rollout
spPolicy for subdomainsreject (if you do not send from subdomains)
adkimDKIM alignment moder (relaxed) - usually fine
aspfSPF alignment moder (relaxed) - usually fine

Common SPF/DKIM/DMARC Mistakes

1

Multiple SPF records on the same domain

DNS only allows one SPF record. If you add a second, receivers evaluate the first and ignore the second - or treat both as invalid. Combine all includes into a single record.

2

Starting DMARC at p=reject

Going straight to reject without monitoring will block legitimate emails from sources you did not know about (a CRM tool, an HR system, a transactional email provider). Always start at p=none for 2-4 weeks.

3

Missing DKIM selector in DNS

Providers sometimes give you a DKIM record but you add it to the wrong subdomain. The full DKIM record name is [selector]._domainkey.yourdomain.com - confirm both the selector name and the _domainkey portion are correct.

4

Not setting up authentication on sending domains (not just the main domain)

Cold email teams often send from multiple domains (yourdomain.com, yourdomain-outreach.com, etc.). Each domain needs its own SPF, DKIM, and DMARC records. The main company domain records do not cover secondary sending domains.

5

Forgetting DNS propagation time

DNS changes can take 24-48 hours to propagate globally. Do not test immediately after adding records - wait at least 30 minutes and use a TTL-aware checker like MXToolbox.

Authentication configured - now clean your list

SPF, DKIM, and DMARC prove to ISPs that your emails are authentic. They do not prevent bounces from invalid addresses. A verified domain sending to an unverified list will still accumulate bounce damage. Authentication and list verification work together - one without the other leaves deliverability gaps.

AL

Written by

Ayoub Lebda

Founder, BounceZero - Email-infrastructure engineer

Ayoub built BounceZero's 5-stage validation pipeline, its dedicated BGP-announced IP infrastructure, and the Patroni HA PostgreSQL cluster behind every verification. Previously built high-volume email delivery infrastructure. Trained at 1337 Benguerir (École 42 network, 2019). Open-source: bgp_analyzer.

Deliverability & sender reputation

Provider behaviour, DNS setup, warm-up, and inbox placement