SPF, DKIM and DMARC are three DNS-based standards, and together they let a receiving mail server check whether email claiming to be from your domain actually is. SPF spells out which servers are allowed to send for you. DKIM signs each message cryptographically. DMARC ties the two together, links them to the visible From address, and tells receivers exactly what to do when a check fails.
Here's the underlying problem: SMTP, the protocol email runs on, was never built with sender verification in mind. Anyone can type From: [email protected] into a message header, and that single fact is what makes phishing so easy. These three standards exist to close that gap, and at this point they're not optional extras. Since February 2024, Google and Yahoo have required bulk senders to authenticate with SPF and DKIM and to publish a DMARC policy — and even senders well below that threshold face stricter filtering without them.
SPF: Sender Policy Framework
SPF itself is just a TXT record sitting at your domain, listing the servers and services allowed to send mail on its behalf. When a message shows up, the receiving server pulls the domain from the envelope sender (that's the hidden "Return-Path" address used for bounces — not necessarily what shows in the From header), looks up its SPF record, and checks whether the connecting IP address made the list.
example.com. 3600 IN TXT "v=spf1 ip4:192.0.2.25 ip6:2001:db8::25 include:_spf.example.net mx ~all"
Reading left to right, here's what each piece does:
v=spf1identifies the record as SPF.ip4:andip6:authorize specific addresses or ranges.include:pulls in another domain's SPF record, which is how you authorize an email provider or newsletter service.mxauthorizes the hosts in your MX records.~allis the catch-all for everything else.
~all vs -all
So what happens to a sender that matches nothing on the list? That's decided by the final mechanism:
| Qualifier | Result | Meaning |
|---|---|---|
-all | Fail | Unlisted servers are not authorized; reject or treat as spoofed. |
~all | Softfail | Probably not authorized; accept but treat with suspicion. |
?all | Neutral | No statement either way. |
+all | Pass | Anyone may send. Never use this; it makes SPF useless. |
-all is the strictest option, sure, but once DMARC is enforced it's DMARC that decides what happens to failing mail anyway — which is why plenty of administrators stick with ~all instead, just to avoid rejecting a legitimately forwarded message outright before DMARC even gets evaluated. Either setting is fine as long as your list of senders is genuinely complete.
The 10-DNS-lookup limit
Receivers don't want to run unlimited DNS lookups just to evaluate one record, so the SPF specification (RFC 7208) caps it at 10 mechanisms that trigger DNS queries: include, a, mx, ptr, exists and the redirect modifier all count toward that limit, including any nested inside an included record. ip4, ip6 and all don't count. Go over 10 and SPF returns a permerror, which receivers simply treat as a failure. Every email service you bolt on tends to cost at least one lookup, so it's worth auditing the record each time you add a provider — drop services you've stopped using, and swap a or mx for explicit ip4 ranges wherever that's practical.
v=spf1 and you'll trigger a permerror. Merge them into a single record instead.DKIM: DomainKeys Identified Mail
DKIM (RFC 6376) takes a different approach: it signs each outgoing message digitally. The sending server signs selected headers plus the body with a private key and tacks on a DKIM-Signature header. On the receiving end, the server fetches the matching public key from DNS and verifies the signature — which proves two things at once: the message really was authorized by the signing domain, and nothing touched it in transit.
Selectors
The signature names a selector (s=) and a domain (d=), and that's what tells the receiver where to find the key — at selector._domainkey.domain:
DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=mail2026; ...
mail2026._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqh...IDAQAB"
Why bother with selectors at all? Because they let a domain publish several keys at once — one per email service, say, or one per generation of keys. That's what makes rotation painless: publish a new selector, point signing at it, and only retire the old key once everything signed with it has actually been delivered. Use 2048-bit RSA keys where your DNS host allows it, and if a key is too long for one string, split it across several quoted strings — a single TXT string tops out at 255 characters.
One thing DKIM has over SPF: its signatures usually survive forwarding, provided the forwarder leaves the message alone, which is what makes it the more robust mechanism of the two.
DMARC: tying it together
Here's the gap SPF and DKIM leave open: each one verifies a domain, but not necessarily the one sitting in the visible From header that a person actually reads. Nothing stops a spammer from passing SPF for their own domain while displaying yours instead. DMARC (RFC 7489) closes that gap through alignment, and on top of that it lets you publish a policy and get reports back.
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=none; rua=mailto:[email protected]; adkim=r; aspf=r"
p=is the policy for failing mail:none,quarantineorreject.rua=is where receivers send daily aggregate reports.sp=optionally sets a different policy for subdomains.adkim=andaspf=set alignment to relaxed (r, the default) or strict (s).pct=applies the policy to a percentage of failing mail.
Alignment
A message passes DMARC when either SPF or DKIM passes and lines up with the From domain. Relaxed alignment is forgiving — the domains just need to share the same organizational domain, so a DKIM signature from mail.example.com still aligns fine with From: [email protected]. Strict alignment isn't; there, they have to match exactly.
In practice, the failure people run into most is a third-party service — a CRM, a newsletter tool, whatever — sending mail with its own bounce domain and its own DKIM key. SPF and DKIM both pass, just for the provider's domain rather than yours, so neither aligns and DMARC fails anyway. The fix is to configure the service to sign with DKIM on your own domain instead (usually that just means publishing the CNAME or TXT records it hands you) and, where it's supported, setting up a custom return-path subdomain too.
A safe DMARC rollout plan
- Inventory senders. Write down every system that sends mail as your domain — your mailbox provider, the website, invoicing, marketing, the support desk.
- Publish SPF and enable DKIM for each of them.
- Start with
p=noneand aruaaddress. Delivery doesn't change at all yet; this just gets the reports flowing. - Read the aggregate reports for a few weeks. They're XML files, one entry per sending IP, showing how many messages passed or failed SPF, DKIM and alignment. A DMARC report analyzer makes them far less painful to read. Chase down and fix every legitimate source that's failing.
- Move to
p=quarantine, withpct=if you'd rather ramp up gradually. Failing mail now lands in spam. - Move to
p=rejectonce the reports show nothing but unauthorized sources failing. At that point, receivers enforcing DMARC simply refuse spoofed mail using your exact domain.
v=spf1 -all plus a DMARC record set to p=reject, and nobody can spoof it.Mailbox provider requirements
Since February 2024, Google and Yahoo have required bulk senders — Google's own threshold is roughly 5,000 or more messages a day to personal Gmail accounts — to authenticate with both SPF and DKIM, publish a DMARC record (p=none at a minimum), align the From domain with SPF or DKIM, offer one-click unsubscribe, and keep spam complaint rates down. Microsoft announced similar rules for its consumer Outlook.com domains in 2025. Send nowhere near that volume? Meeting these requirements anyway is still the simplest way to stay out of spam folders. Valid reverse DNS on your sending IPs matters here too.
Common errors and fixes
- Multiple SPF records: merge them into one.
- Too many lookups: remove unused includes and flatten where safe.
- SPF record on the wrong name: it belongs at the domain used in the envelope sender (often the apex) — not at
_dmarcorwww. - DKIM key not found: double-check the selector spelling and that the record actually sits at
selector._domainkey— some DNS panels append the domain automatically, which produces a doubled name. - DMARC record on the apex: it must be at
_dmarc.example.com. - Forwarded mail failing: forwarding breaks SPF almost by definition, so make sure DKIM is in place — it's the one that usually survives.
Our SPF and DMARC checker catches a lot of these automatically, the MX lookup confirms where your mail actually gets delivered, and the DNS lookup tool will fetch any DKIM selector's TXT record for you.
Frequently asked questions
Do I need all three?
Yes. SPF and DKIM handle authentication, but it's DMARC alone that connects them to the From address people actually see, and it's DMARC that lets you request enforcement. Major mailbox providers expect to see all three from anyone sending at volume.
Will p=reject block my legitimate email?
It can, if some legitimate sender hasn't been aligned yet — which is exactly why you start at p=none and lean on aggregate reports to find and fix every source before you enforce anything.
How do I find my DKIM selector?
Open a message you've sent, pull up its original source or headers, and look for the DKIM-Signature header. The s= value is your selector, and d= is the signing domain. Your email provider's setup guide will list it too.
Does SPF check the From address?
No — SPF only checks the envelope sender, the Return-Path. That's precisely why DMARC alignment exists: to protect the visible From address that SPF never looks at.
Comentarios
Comparte un consejo, haz una pregunta o cuenta cómo te funcionó la herramienta.