SPF, DKIM, and DMARC are email authentication standards that verify a sender is allowed to use a domain, ensuring messages aren't forged. SPF checks the sending server's IP, DKIM adds a digital signature, and DMARC tells receivers what to do if checks fail.
Why Email Authentication Matters
Without authentication, anyone can forge your domain and send phishing emails that look like they come from you. This damages your reputation, gets your legitimate emails marked as spam, and harms recipients. Authentication helps protect your brand and improves deliverability by proving to mailbox providers that your emails are genuine.
SPF: Sender Policy Framework
SPF is a DNS record that lists which IP addresses are allowed to send email for your domain. When a message arrives, the receiving server checks the SPF record to see if the sender's IP is on the list. If it isn't, the email may be rejected or marked as spam.
- SPF record example:
v=spf1 ip4:192.0.2.1 include:_spf.example.com ~all ~allmeans soft fail (accept but flag),-allmeans hard fail (reject).- SPF only checks the envelope sender (Return-Path), not the visible From address.
DKIM: DomainKeys Identified Mail
DKIM uses a private key to sign outgoing emails, and a public key published in DNS to verify the signature. The signature covers specific headers and the body, so any alteration breaks it. This proves the email wasn't tampered with and that it genuinely came from your domain.
- DKIM record example:
v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC... - Signatures are added by your email service provider, not by you manually.
- Each selector (like
s1orgoogle) has its own record.
DMARC: Domain-based Message Authentication, Reporting & Conformance
DMARC builds on SPF and DKIM. It tells receivers what to do if an email fails authentication—none, quarantine, or reject—and where to send reports. DMARC also aligns the domain in the From header with the domains used in SPF and DKIM, preventing look-alike domains.
- DMARC record example:
v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com - Policy levels:
none(monitor),quarantine(spam folder),reject(block). - Alignment: strict or relaxed for SPF and DKIM domains.
How to Set Up All Three
- Check your current SPF and DKIM records using online tools or your DNS provider.
- Publish an SPF record listing all legitimate sending IPs and services.
- Enable DKIM in your email service provider's settings and publish the public key.
- Start with a DMARC policy of
noneto monitor traffic. - Review DMARC reports to see which legitimate emails fail.
- Gradually tighten the policy to
quarantine, thenreject.
Common Problems and Misconceptions
One common issue is SPF failure due to forwarding—when an email is forwarded, the original SPF check may fail. DMARC helps because DKIM signatures survive forwarding. Another misconception is that DMARC alone stops spoofing; it only works if SPF or DKIM passes and aligns. Also, don't use multiple SPF records—combine them into one.
If you use third-party senders (like newsletters), include their IPs in SPF or use their DKIM signatures. Regularly check your DMARC reports to catch issues early.
Costs and Maintenance
Setting up these records is free—you only need access to your DNS. However, ongoing maintenance includes updating SPF when you change email providers, rotating DKIM keys periodically, and monitoring DMARC reports. Many email services offer tools to simplify this, but they may charge for advanced analytics.
Alternatives and Complementary Tools
While SPF, DKIM, and DMARC are the core, other standards like BIMI (Brand Indicators for Message Identification) display your logo in supported mail clients. MTA-STS and TLS-RPT enhance transport security. These are not replacements but add extra layers of trust.
Frequently Asked Questions
Do I need all three?
Yes, for full protection. SPF and DKIM alone don't prevent exact-domain spoofing; DMARC is needed to enforce alignment and tell receivers what to do with failed messages.
What does "alignment" mean in DMARC?
Alignment checks that the domain in the From header matches the domain used in SPF or DKIM. Relaxed alignment allows subdomains, while strict requires an exact match.
How do I read DMARC reports?
Reports are XML files sent to the address in rua. You can use free parsers or services to visualize them, showing which IPs sent and whether they passed or failed.
Can I set up DMARC without SPF or DKIM?
Technically yes, but it's pointless—DMARC will fail all emails because there's nothing to authenticate. You must have at least one of SPF or DKIM working.
Why do my emails still go to spam after setting these up?
Authentication is one factor among many. Content, sender reputation, and user engagement also matter. Check your spam score and ensure your sending practices are clean.