The complete SPF, DKIM, and DMARC setup guide (2025 edition)
With Google and Yahoo enforcing stricter sender requirements in 2024-2025, proper email authentication is no longer optional. Here is the definitive setup guide.
SPF (Sender Policy Framework)
SPF tells receiving servers which IP addresses are authorized to send email from your domain. Add a TXT record to your DNS:
v=spf1 include:_spf.google.com include:spf.brew.new -allDKIM (DomainKeys Identified Mail)
DKIM adds a cryptographic signature to your emails. Your ESP will provide a CNAME or TXT record to add. This proves the email was not tampered with in transit.
DMARC (Domain-based Message Authentication)
DMARC ties SPF and DKIM together and tells receivers what to do when checks fail. Start with monitoring mode:
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com; pct=100After collecting reports for 2-4 weeks, move to p=quarantine and eventually p=reject.
Common mistakes
- Having multiple SPF records (you can only have one)
- Using
+allinstead of-allin SPF - Jumping straight to DMARC
p=rejectwithout monitoring - Forgetting to authenticate subdomains