SPF, DKIM, and DMARC are three email authentication standards that work together to verify that an email claiming to come from a specific domain actually was sent by that domain's owner. In plain English: SPF checks the sending server's IP address, DKIM checks a digital signature, and DMARC tells receiving mail servers what to do if those checks fail. Together, they stop spammers and scammers from forging your domain in phishing emails.
Why Email Authentication Matters
Email was designed in the 1970s without any built-in way to prove who sent a message. The "From" address you see is just text — anyone can type any address they want. That's why phishing works: a criminal can send an email that looks like it's from your bank, your boss, or your own company. SPF, DKIM, and DMARC close that loophole by letting domain owners publish rules that receiving mail servers can check automatically.
Without these standards, your domain can be used in spam or scam campaigns. That harms your reputation, and legitimate emails from you may land in spam folders. With them, you protect your brand and your recipients.
SPF: The Sender Policy Framework
SPF is the simplest of the three. It's a DNS record (a TXT record) that lists which IP addresses are allowed to send email for your domain. When a mail server receives a message, it looks up the SPF record for the domain in the "From" address and checks whether the sending server's IP is on that list.
For example, if your domain is example.com and you send mail through Google Workspace, your SPF record might look like:
v=spf1 include:_spf.google.com ~all
That means: "Allow Google's servers, and for anyone else, mark it as a soft fail." The ~all is a soft fail; -all is a hard fail. SPF alone has a weakness: it checks the envelope sender (the return-path), not the visible "From" header. A spammer can still forge the visible From and use a different envelope domain that passes SPF. That's why DKIM and DMARC exist.
DKIM: DomainKeys Identified Mail
DKIM adds a digital signature to each email. The sending server signs the message with a private key, and the receiving server looks up the public key in the domain's DNS to verify the signature. If the signature matches, the message hasn't been tampered with and truly came from that domain.
DKIM signatures are stored in the email headers as d=example.com and s=selector. The selector tells the receiver where to find the public key: selector._domainkey.example.com. Unlike SPF, DKIM survives forwarding because the signature is attached to the message body and certain headers, not to the sending server's IP.
However, DKIM alone doesn't tell the receiver what to do if the signature fails. It also doesn't prevent a spammer from using a domain that doesn't have DKIM at all. That's where DMARC comes in.
DMARC: Domain-based Message Authentication, Reporting & Conformance
DMARC is the policy layer. It tells receiving mail servers what to do if both SPF and DKIM fail (or if one passes but the other fails). DMARC also gives domain owners a way to receive reports about authentication results, so they can see who is trying to use their domain.
A DMARC record is a DNS TXT record at _dmarc.example.com. It looks like:
v=DMARC1; p=none; rua=mailto:dmarc@example.com
The p (policy) can be:
- none — monitor only, no action taken
- quarantine — send failing mail to spam
- reject — block the email entirely
DMARC also requires alignment: the domain in the "From" header must match the domain used in SPF or DKIM. This closes the loophole where SPF passes on a different envelope domain.
How They Work Together
Think of it like a package delivery. SPF is the return address on the box — it says which warehouse the package came from. DKIM is the tamper-proof seal — it proves the box wasn't opened in transit. DMARC is the receiving dock's policy — it says what to do if the return address is wrong or the seal is broken.
For an email to pass DMARC, it must pass at least one of SPF or DKIM, and the domain in the From header must align with the domain that passed. If neither passes, the receiver applies the DMARC policy.
Example: Your domain is example.com. A spammer sends an email with From: ceo@example.com but uses their own server. SPF fails because their IP isn't in your SPF record. DKIM fails because they don't have your private key. DMARC policy is reject, so the email is dropped before it reaches the inbox.
How to Set Them Up
Setting up these records requires access to your domain's DNS settings. The exact steps depend on your email provider, but the general process is:
- Create an SPF record that lists all legitimate sending IPs or includes your provider's SPF include. Keep it to one SPF record per domain — multiple records cause failures.
- Generate a DKIM key pair in your email provider's admin console. Publish the public key as a TXT record at the selector address they give you.
- Start with a DMARC policy of
p=noneand add anruaemail address to receive reports. Review the reports for a week or two to see which legitimate senders are failing. - Once you're confident, tighten the policy to
quarantine, then eventuallyreject.
Many email providers (Google Workspace, Microsoft 365, etc.) offer step-by-step guides for their own platforms. DNS changes can take up to 48 hours to propagate.
Common Problems and Misconceptions
- Multiple SPF records — This causes SPF to fail with "permerror." Always use a single SPF record that includes all sources.
- DMARC alignment with subdomains — DMARC on the parent domain doesn't automatically cover subdomains unless you use a wildcard (
sptag) or publish separate records. - Forwarders — When an email is forwarded, SPF may fail because the forwarding server isn't in the original SPF record. DKIM usually survives, so DMARC can still pass if DKIM passes.
- Third-party senders — If you use a marketing service, make sure they are included in your SPF and DKIM setup, or their emails will fail authentication.
- "DMARC is a spam filter" — DMARC doesn't filter spam; it only verifies the sender's identity. Content filtering is separate.
Costs and Alternatives
SPF, DKIM, and DMARC are free to implement — they're just DNS records. The only cost is your time and possibly a tool for monitoring DMARC reports (many free and paid options exist). Alternatives or supplements include:
- BIMI — Displays your logo next to authenticated emails, but requires DMARC with a reject policy.
- MTA-STS and TLS-RPT — Enforce encrypted transport between mail servers.
- DKIM with ARC — Helps with forwarded email authentication.
These are not replacements for SPF/DKIM/DMARC; they build on them.
Frequently Asked Questions
What happens if I don't set up DMARC?
Without DMARC, receiving servers have no policy to apply when SPF or DKIM fail. They may still reject or quarantine based on their own rules, but spammers can more easily forge your domain because there's no clear instruction to block it.
Can I use SPF, DKIM, and DMARC with any email provider?
Yes, as long as you control your domain's DNS. Even if you use Gmail, Outlook, or a custom mail server, you can publish these records. The provider may also help you configure DKIM keys.
Do these standards stop all phishing?
No. They stop domain spoofing — emails that fake your domain. They don't stop phishing that uses lookalike domains (like examp1e.com) or compromised accounts. They also don't stop malicious content from a legitimately authenticated sender.
How long does it take for DMARC to work?
DNS changes propagate within 48 hours, but you should run in p=none for at least a week to gather reports and ensure you don't block legitimate mail. Then tighten the policy gradually.
What is a DMARC report?
It's an XML file sent to the address in your rua tag, summarizing which emails passed or failed authentication for your domain. You can read them manually or use a service to visualize them.
Is DMARC required by law?
Not generally, but some industries and government agencies require it for compliance. For example, the U.S. federal government mandates DMARC for its domains. Many email providers also give better deliverability to authenticated senders.