Executive Summary · 9 min read
SPF authorizes sending IP infrastructure, DKIM signs email headers cryptographically to prevent tampering, and DMARC ties them both to your visible From domain while telling inbox providers how to handle failures.
Key Takeaways
- Never publish two separate v=spf1 TXT records on the same domain—merge mechanisms into one record staying <=10 DNS lookups.
- Use 2048-bit RSA keys whenever your DNS host supports long TXT strings cleanly.
- Start DMARC safely with p=none plus rua reporting before graduating to p=quarantine and p=reject.
1. SPF (Sender Policy Framework — RFC 7208)
An SPF record lives as a single DNS TXT record on your root domain (or subdomain):
v=spf1 include:_spf.yourprovider.com ~all
v=spf1declares SPF version 1.include:imports authorized IP ranges from your mail infrastructure.~all(softfail) marks unlisted servers suspicious;-all(hardfail) instructs strict rejection. Avoid+all, which authorizes the entire internet.
Critical Pitfall: RFC 7208 strictly enforces a maximum of 10 DNS lookups across nested include: directives. Exceeding 10 lookups triggers an automatic permerror—read our guide on avoiding SPF PermError.
2. DKIM (DomainKeys Identified Mail — RFC 6376)
DKIM attaches a signed hash of selected headers (like From, Subject, Date) and the message body inside a DKIM-Signature: header. Recipients query the public key at:
selector._domainkey.yourdomain.com TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG..."
Gmail and Yahoo require at least 1024-bit DKIM keys, with 2048-bit strongly recommended.
3. DMARC (Domain-based Message Authentication, Reporting, and Conformance)
DMARC solves the alignment gap: a spammer could pass SPF/DKIM using their own hidden domain while displaying your brand in the visible From: header. DMARC enforces that at least SPF (via Envelope-From/Return-Path) OR DKIM (d= tag) aligns with the visible From: header domain.
_dmarc.yourdomain.com TXT "v=DMARC1; p=quarantine; pct=100; rua=mailto:dmarc@yourdomain.com"
Test your domain syntax instantly with the UltyMailer DNS Validator.
Put this guide into practice on your domain
Test your SPF/DKIM/DMARC records, analyze raw email headers, or simulate campaign volume with UltyMailer’s free tools.
