ZoneProbe

SPF, DKIM and DMARC explained

Three DNS records decide whether the world believes email that says it's from your domain. Here's what each one does, how receiving servers combine them, and why one or two on their own aren't enough.

By ZoneProbeUpdated 8 min read

The problem they solve

Email was designed in the early 1980s for a network where everyone knew each other. The protocol that moves mail between servers, SMTP, lets the sender write anything in the From line, much like the return address on a paper envelope. Nothing in the original design stops a stranger sending a message "from" [email protected] or [email protected].

That gap is what phishing, invoice fraud and most spam rely on. SPF, DKIM and DMARC close it. They don't change how email is sent; they add a few records to your domain's DNS that let any receiving server check whether a message really came from you, and tell it what to do when it didn't.

In short:

  • SPF lists the servers allowed to send email for your domain.
  • DKIM signs each message so receivers can tell it came from you and wasn't changed.
  • DMARC ties both to the From address people actually see, tells receivers what to do when a message fails, and sends you reports about it.

How a receiving server checks a message

When a message arrives at Gmail, Outlook or any other well-run mail server, the checks happen in a fraction of a second, before the message reaches the inbox:

A sending server delivers a message to a receiving server, which looks up the sender's SPF, DKIM and DMARC records in DNS and then delivers, quarantines or rejects the message. Sending server From: [email protected] IP 203.0.113.25 message Receiving server 1 SPFIs this IP allowed to send? 2 DKIMDoes the signature verify? 3 DMARCDid one pass for the From domain? DNS for example.com @ v=spf1 … s1._domainkey p=… _dmarc v=DMARC1 … looks up Outcome Pass: deliver normally Fail: follow the DMARC policy
All three checks rely on records you publish in your own domain's DNS. The receiving server does the work.

The important detail is that the receiver looks up your DNS. Only someone who controls your domain can publish those records, which is what makes the checks trustworthy.

SPF: which servers may send

SPF (Sender Policy Framework, RFC 7208) is a single TXT record on your domain that lists the servers allowed to send its email:

example.com.  TXT  "v=spf1 include:spf.protection.outlook.com ip4:203.0.113.25 -all"

Read left to right, this says: Microsoft 365's servers may send for us, so may the server at 203.0.113.25, and nothing else should (-all). When a message arrives, the receiver takes the IP address that connected to it and checks it against the list.

What SPF actually checks

This is the part most people miss. SPF doesn't check the From address you see in your mail app. It checks the envelope sender, also called the Return-Path or MAIL FROM: a hidden address used for bounces, which is set by whichever system sends the message. When a newsletter service sends on your behalf, the envelope sender is often one of its domains, so the SPF check is about the service's domain, not yours.

That means a spammer can pass SPF easily: use their own domain in the envelope, your domain in the visible From line, and SPF says "pass" for the wrong domain. SPF alone doesn't stop spoofing of the address people see. That's DMARC's job.

SPF's limits

  • Forwarding breaks it. When a message is forwarded, for example from a university address to a personal Gmail account, it arrives from the forwarder's IP address, which isn't in your SPF record.
  • The 10-lookup limit. Evaluating SPF may take at most 10 DNS lookups. Each include counts, and so do the includes inside it. Domains that use many services hit this limit and SPF stops working entirely. Our guide on fixing "too many DNS lookups" covers it in detail.
  • One record only. A domain must have exactly one SPF record. Two records is an error, and SPF fails.

DKIM: a signature on every message

DKIM (DomainKeys Identified Mail, RFC 6376) uses public-key cryptography. Your mail system holds a private key and adds a signature to each outgoing message, covering the body and important headers such as From, Subject and Date. The matching public key is published in DNS:

s1._domainkey.example.com.  TXT  "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA…"

The signature travels with the message in a DKIM-Signature header. Two of its tags matter most: d=, the domain that signed it, and s=, the selector that says where to find the key (s1 above). The receiver fetches the key, checks the signature, and knows two things: the message was signed by someone holding example.com's private key, and the signed parts haven't been changed since.

Why DKIM matters more than it looks

  • It survives forwarding. The signature is part of the message, so it still verifies after a simple forward, where SPF fails.
  • It works for services that send for you. Most email platforms let you sign with your own domain by publishing a key (usually as a CNAME record they give you). That makes their mail authenticate as yours, without adding them to your SPF record.
  • Several keys can coexist. Each service gets its own selector, and keys can be rotated without downtime.

DKIM's limits

Like SPF, DKIM by itself says nothing about the visible From address. A spammer can sign their messages with their domain, and DKIM passes, for the wrong domain. Mailing lists that change the subject line or add a footer also break signatures, because the signed content changed.

DMARC: tying it together

DMARC (Domain-based Message Authentication, Reporting and Conformance, RFC 9989, which in 2026 replaced the original RFC 7489) answers the question SPF and DKIM leave open: did the message authenticate as the domain in the From address? It's a TXT record at _dmarc:

_dmarc.example.com.  TXT  "v=DMARC1; p=reject; rua=mailto:[email protected]"

A message passes DMARC if at least one of these is true:

  • SPF passed, and the envelope sender's domain matches the From domain.
  • A DKIM signature verified, and its d= domain matches the From domain.

That "matches" requirement is called alignment, and it's the key idea in the whole system.

Alignment, with examples

By default alignment is relaxed: the domains only need to share the same organizational domain, so mail.example.com aligns with example.com. With strict alignment (adkim=s, aspf=s) they must be identical.

Visible FromSPF passed forDKIM signed byDMARC
example.comexample.com—Pass (SPF aligned)
example.combounces.mailservice.netexample.comPass (DKIM aligned)
example.combounces.mailservice.netmailservice.netFail: both passed, but neither for example.com
example.comattacker.testattacker.testFail: a spoof
example.comnews.example.com—Pass with relaxed alignment, fail with strict

The third row is the classic case of legitimate mail failing DMARC: a service that sends on your behalf but authenticates only as itself. The fix is to set up DKIM for your domain in that service.

The policy

The p= tag tells receivers what to do with mail that fails:

  • p=none: deliver it as usual, but send me reports. This is monitoring mode.
  • p=quarantine: treat it as suspicious, usually by putting it in spam.
  • p=reject: refuse it during delivery. The spoofed message never arrives.

The reports

The rua= tag asks receivers to send you daily aggregate reports: XML files that list every IP address that sent mail using your domain, how many messages, and whether they passed SPF, DKIM and DMARC. They contain no message content. These reports are how you discover every service sending as you, including ones nobody told IT about, before you turn on enforcement.

Why you need all three

SituationSPF onlyDKIM onlyAll three
Spammer spoofs your From addressNot stoppedNot stoppedRejected or sent to spam
Message forwarded to another mailboxFailsUsually passesUsually passes (via DKIM)
Newsletter service sends for youPasses for its domain onlyPasses if it signs as youPasses once DKIM is set up as you
You learn who sends as your domainNoNoYes, from DMARC reports

SPF and DKIM are the evidence; DMARC is the rule that says which evidence counts and what to do when it's missing. Publishing DMARC with only one of the other two works, but you lose resilience: with SPF alone, forwarded mail fails; with DKIM alone, any service that can't sign as you fails.

What the big mailbox providers require

Email authentication used to be best practice. It's now a condition of delivery:

  • Google and Yahoo (since February 2024): everyone sending to their users needs SPF or DKIM. Bulk senders, roughly 5,000 or more messages a day to Gmail, need SPF and DKIM, a DMARC record (at least p=none), a From address that aligns with SPF or DKIM, one-click unsubscribe for marketing mail, and a low spam-complaint rate.
  • Microsoft (since May 2025): high-volume senders to Outlook.com, Hotmail and Live addresses need SPF, DKIM and DMARC (at least p=none), aligned with SPF or DKIM. Since 5 May 2025, non-compliant mail goes to the Junk folder, and Microsoft has said rejection will follow.

Even below those volumes, mail without authentication is far more likely to land in spam, because unauthenticated mail is what spam mostly looks like.

What else builds on them

  • BIMI shows your logo next to your messages in supporting mail apps. It requires DMARC at quarantine or reject, for the domain and its subdomains, applied to all mail.
  • ARC (RFC 8617, still an experimental standard) lets forwarders and mailing lists vouch for the authentication results a message had before they changed it.
  • MTA-STS and TLS-RPT are different: they protect the connection between mail servers, making sure mail to your domain is encrypted in transit.

Where to start

  1. Check what you have. Run the SPF, DKIM and DMARC checks on your domain.
  2. List everything that sends as your domain: your mailbox provider, marketing and newsletter tools, CRM, helpdesk, billing, website forms, scanners and printers.
  3. Make sure each one passes SPF or DKIM for your domain, preferably DKIM.
  4. Publish DMARC at p=none with reports, using the DMARC generator, then move to quarantine and reject as the reports come back clean.

Our step-by-step guide, How to set up DMARC, walks through that rollout in detail.

Frequently asked questions

Do SPF, DKIM and DMARC stop all spam?

No. They stop people sending mail that pretends to be from your exact domain. Spammers can still send from their own domains, which may pass all three, and they can use look-alike domains. Spam filters handle the rest using reputation and content.

Does DMARC protect against look-alike domains?

No. DMARC only protects the exact domain that publishes it, and its subdomains. A domain like examp1e.com is someone else's domain with its own records. Registering obvious variations of your domain, and monitoring for new ones, is the defense there.

Which should I set up first?

SPF and DKIM for every service that sends as you, then DMARC at p=none with reports. The reports tell you what you missed. Move to enforcement last.

Do I need these records if my domain doesn't send email?

Yes, arguably more. Unused domains are easy to spoof because nobody watches them. Publish v=spf1 -all and v=DMARC1; p=reject to declare that the domain sends no email at all.

Are SPF, DKIM and DMARC records secret?

No. They're public DNS records that anyone can look up, by design: receivers all over the world need to read them. The DKIM private key is the only secret, and it never goes in DNS.

Tools for this guide

Keep reading

How to set up DMARC, step by stepFrom your first record to p=reject, without blocking your own email.8 min read · Updated November 29, 2026Protecting a domain that doesn't send emailParked, defensive and website-only domains: the records that stop anyone sending mail as them.5 min read · Updated November 29, 2026SPF, DKIM and DMARC for Microsoft 365Set up email authentication for a custom domain in Microsoft 365 and Exchange Online, step by step.7 min read · Updated November 29, 2026SPF, DKIM and DMARC for Google WorkspaceSet up email authentication for your domain in Google Workspace and Gmail, step by step.7 min read · Updated November 29, 2026