Security

How to Set Up SPF, DKIM, and DMARC Records (Step-by-Step)

Published 2026-03-26 · 5 min read

Why You Need All Three

SPF, DKIM, and DMARC work together. SPF says WHO can send. DKIM proves the message wasn't altered. DMARC tells receivers what to do when checks fail.

Setting Up SPF

1. List your senders: Your mail server, ESP (Mailchimp, etc.), transactional (SendGrid, etc.)

2. Create TXT record:
v=spf1 include:_spf.google.com include:sendgrid.net -all

Tips:
- Use -all (hard fail) not ~all (soft fail)
- Keep under 10 DNS lookups
- Don't use +all ever

Setting Up DKIM and DMARC

DKIM: Generate keys through your email provider. Add the public key as a TXT record at selector._domainkey.yourdomain.com

DMARC: Start with monitoring mode:
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com

After reviewing reports, move to quarantine then reject:
v=DMARC1; p=reject; rua=mailto:dmarc@yourdomain.com

Check your configuration with our free email security tool.

Free Security Scanner

Check your website in 30 seconds. No signup required.

Scan Your Site Now →