SPF, DKIM & DMARC Email Authentication Setup Guide

Modern bulk-sender requirements from Gmail and Yahoo require properly aligned SPF, DKIM, and DMARC records. Use this reference to configure DNS records cleanly and avoid common deliverability pitfalls.

Mechanism / TagDNS Host & TypeExample ValueBest Practices & Notes
SPF (Basic)@ (TXT)v=spf1 include:_spf.google.com ~allDeclares authorized senders. Publish strictly ONE SPF TXT record per domain (multiple records cause PermError).
SPF (~all / -all)@ (TXT)~all (SoftFail) / -all (HardFail)Use ~all during rollout or when mail forwarding exists; move to -all for strict enforcement.
SPF (Non-sending)@ (TXT)v=spf1 -allExplicitly blocks spoofing on parked or web-only domains that never send email.
SPF 10-Lookup Limitinclude / a / mx / redirectMax 10 DNS lookups totalExceeding 10 nested DNS lookups triggers PermError and breaks SPF. Prune unused SaaS includes.
DKIM Public Key<selector>._domainkey (TXT)v=DKIM1; k=rsa; p=MIIBIjANBg...Cryptographically signs headers and body. Use 2048-bit RSA keys (1024-bit is discouraged).
DMARC Monitor_dmarc (TXT)v=DMARC1; p=none; rua=mailto:dmarc@example.comPhase 1: Collect aggregate XML reports (RUA) without impacting delivery to audit all legitimate senders.
DMARC Quarantine_dmarc (TXT)v=DMARC1; p=quarantine; pct=25; rua=mailto:...Phase 2: Send failing messages to spam. Gradually increase pct from 10 → 25 → 50 → 100.
DMARC Reject_dmarc (TXT)v=DMARC1; p=reject; sp=reject; adkim=r; aspf=rPhase 3: Block spoofed mail outright. Set sp=reject to protect unused subdomains as well.
Alignmentadkim / aspfr (Relaxed, default) / s (Strict)Controls how strictly the From header domain must match SPF/DKIM domains. Relaxed (r) allows subdomains.
BIMI (Brand Logo)default._bimi (TXT)v=BIMI1; l=https://example.com/logo.svgRequires DMARC enforcement (p=quarantine or p=reject) to display verified brand logos in inboxes.

Practical Notes

  • Always roll out DMARC in stages: p=none → p=quarantine → p=reject so transactional senders (SES, SendGrid, billing SaaS) are not accidentally blocked.
  • Watch the 10-DNS-lookup SPF limit closely when combining Google Workspace, Microsoft 365, and marketing tools.
  • Verify your live DNS records immediately using the Email Auth Checker tool linked below.

Email Auth Checker (SPF/DMARC/MX)