SPF, DKIM and DMARC explained (and how to set them up)

By Fil, IT technician with 20+ years in the job · 6 December 2026

The short answer: they're three DNS records that prove your email really comes from you. SPF lists the servers allowed to send for your domain, DKIM adds a digital signature so the message can't be altered, and DMARC tells receivers what to do when a message fails, and sends you reports. Set up all three and your email is far less likely to land in spam, and far harder for anyone to fake.

Email was designed in an age when everyone trusted everyone. Anyone can put any address in the "From" line, in the same way that anyone can write any return address on an envelope. That's why scammers can send messages that appear to come from your bank, or from your own company. SPF, DKIM and DMARC are the fixes that were added later. They don't stop people trying, but they let receiving mail servers check whether a message is genuine.

SPF: who is allowed to send

Sender Policy Framework is a list, published in your domain's DNS, of the servers allowed to send email for your domain. When a message arrives, the receiving server looks up that list and checks whether the server that delivered it is on it.

A typical SPF record for a business on Microsoft 365 looks like this:

v=spf1 include:spf.protection.outlook.com -all

The include part says "Microsoft's servers are allowed", and -all says "nothing else is". Each service that sends email as your domain (your email provider, a newsletter system, your website's contact form, a helpdesk) needs its own entry.

SPF's limits

DKIM: a signature that proves nothing changed

DomainKeys Identified Mail adds a digital signature to every message you send. Your mail system signs each message with a private key that only it holds, and you publish the matching public key in DNS. The receiving server uses the public key to check the signature. If the message was tampered with on the way, or wasn't signed by you, the check fails.

The public key lives at a name like selector1._domainkey.example.com. The "selector" lets you have several keys at once, one for each service that sends for you, and change them without downtime.

Unlike SPF, DKIM survives forwarding, because the signature travels with the message. You don't usually write DKIM records yourself: each email service generates the key and tells you which record to add.

DMARC: the policy that ties it together

Domain-based Message Authentication, Reporting and Conformance does three jobs:

A DMARC record goes at _dmarc.example.com and looks like this:

v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com

Do I really need all three?

For any domain that sends email, yes. They work as a set: SPF and DKIM do the checking, and DMARC decides what happens and reports back.

The big email providers now insist on it for anyone sending in volume. Since February 2024, Gmail and Yahoo require SPF, DKIM and DMARC from domains sending 5,000 or more messages a day to their users, and Microsoft added the same requirement for Outlook.com, Hotmail and Live addresses in May 2025. Smaller senders aren't formally required to have all three yet, but mail without them is treated with more suspicion, so it's far more likely to end up in spam.

Setting them up, in a safe order

  1. List everything that sends email as your domain. Your mailboxes, plus anything else: website forms, invoicing or accounts software, newsletters, CRM, helpdesk, scanners and printers that email, and any supplier that sends "on your behalf".
  2. Publish one SPF record covering all of them. Our SPF & DMARC Builder lets you tick the services you use, counts the lookups, and can load your current record so you edit rather than start again. Start with ~all (soft fail) if you're not sure you've found everything.
  3. Switch on DKIM at each service that supports it, adding the records each one gives you.
  4. Publish DMARC with p=none and an address for reports. Nothing changes for your email at this stage; you're only watching.
  5. Read the reports for two to four weeks. They arrive as XML attachments, which free DMARC report tools turn into readable summaries. Fix anything genuine that's failing.
  6. Tighten the policy: move to p=quarantine, then p=reject. You can use pct= to apply it to a percentage of failing mail first.

DNS changes usually take effect within an hour; the DNS Propagation Checker shows when the big providers have picked them up.

Checking it works

Common mistakes

Tools for this