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 / Tag | DNS Host & Type | Example Value | Best Practices & Notes |
|---|---|---|---|
| SPF (Basic) | @ (TXT) | v=spf1 include:_spf.google.com ~all | Declares 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 -all | Explicitly blocks spoofing on parked or web-only domains that never send email. |
| SPF 10-Lookup Limit | include / a / mx / redirect | Max 10 DNS lookups total | Exceeding 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.com | Phase 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=r | Phase 3: Block spoofed mail outright. Set sp=reject to protect unused subdomains as well. |
| Alignment | adkim / aspf | r (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.svg | Requires 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.