SPF, DKIM, and DMARC without the jargon
Three DNS records decide whether your email lands in the inbox or the spam folder, and most explanations of them read like an RFC. Here is the version we give clients when we set up their mail and they ask what they actually need. No “cryptographic non-repudiation,” just what each record does and the order to turn them on so you do not blackhole your own newsletter.
Since February 2024 this stopped being optional for anyone sending volume. Gmail and Yahoo now require SPF, DKIM, and DMARC on any domain sending more than 5,000 messages a day to their users, and they quietly raised the bar for smaller senders too. If your invoices or password resets have been going to spam lately, this is usually why.
The one-sentence version of each
SPF is a list of who is allowed to send mail for your domain. DKIM is a signature that proves the message was not tampered with on the way. DMARC is the instruction that tells the receiving server what to do when a message fails the first two, plus a report so you can see who is sending as you. That is the whole thing. Everything else is detail, and the detail is where people lock themselves out, so let us take them one at a time.
SPF: the guest list
SPF (Sender Policy Framework) is a single TXT record in your DNS that names every server allowed to send email using your domain. Your mailbox provider, your CRM, your invoicing tool, the WordPress plugin that fires off contact-form replies. If a server is not on the list, the receiver knows the mail is suspect.
A common mistake is more than one SPF record on a domain. You are allowed exactly one. Two records is not extra protection, it is a syntax error that makes the whole check fail, and the second one is usually left over from a tool someone added in 2021 and forgot. There is also a hard limit of ten DNS lookups inside an SPF record. Big senders blow past it without noticing, SPF returns “permerror,” and receivers treat it as no SPF at all.
DKIM: the wax seal
DKIM (DomainKeys Identified Mail) adds a cryptographic signature to every message you send. The receiving server checks that signature against a public key published in your DNS. If they match, the message is genuinely from you and nobody edited it in transit. If a spammer copies your email, the signature breaks and the receiver knows.
You do not generate DKIM by hand. Your mail provider gives you the key, you paste it into DNS as a TXT or CNAME record, and you switch it on in their dashboard. Google Workspace, Microsoft 365, a Postfix box, cPanel mail, they all hand you the value. The work is in the DNS, not the cryptography.
DMARC: the bouncer, and the part everyone rushes
DMARC ties the first two together and adds a policy. It says: if a message claiming to be from my domain fails both SPF and DKIM, here is what to do with it. Three settings exist. p=none means do nothing, just tell me. p=quarantine means send it to spam. p=reject means bounce it.
Here is where it goes wrong. Someone reads that p=reject is the strong, secure setting, switches it on day one, and finds out a week later that their accountant never got the invoices, because the invoicing tool was never in the SPF record. Now their own policy is rejecting their own mail.
The right order is boring and it works. Publish DMARC at p=none first. Read the reports it sends you for two to four weeks. Those reports show every service sending as your domain, including the ones you forgot about. Fix SPF and DKIM until everything legitimate passes. Then move to p=quarantine, watch for another couple of weeks, and only then go to p=reject. The full ramp takes about a month on a busy domain. Skipping it is how you lose mail.
What the three records look like
All three live in your domain’s DNS as TXT records (DKIM is sometimes a CNAME pointing at your provider). Real examples, with a made-up domain:
- SPF, on the domain itself:
v=spf1 include:_spf.google.com include:sendgrid.net -all. Eachincludeis a service allowed to send;-allsays everything else is not. - DKIM, on a selector name your provider gives you, such as
google._domainkey.example.com:v=DKIM1; k=rsa; p=MIIBIjANBg…, where the long value afterp=is the public key you paste in. - DMARC, on
_dmarc.example.com:v=DMARC1; p=none; rua=mailto:dmarc@example.com. Thepis the policy andruais where the daily reports go.
Alignment: why SPF can pass and DMARC still fail
DMARC does not only ask whether SPF or DKIM passed. It asks whether the one that passed belongs to the same domain as the From address your reader sees. A newsletter tool that sends with its own bounce domain passes SPF for itself, not for you, so DMARC counts it as a fail unless DKIM is signed with your domain. This is the usual reason a domain with “all three records set up” still sees its own mail fail DMARC. The fix is to turn on DKIM signing with your domain in every tool that sends as you, or to give the tool a custom return-path on a subdomain of yours.
Why your mail can fail all of this and still be real
One thing the vendor guides skip: forwarding breaks SPF. If a recipient auto-forwards your email to another address, the forwarding server is not on your SPF list, so SPF fails on the second hop. That is by design and there is nothing wrong with your setup. It is exactly why DMARC accepts a pass from either SPF or DKIM, and why DKIM is the more durable of the two. Get DKIM right and forwarded mail still authenticates.
How to check what you have right now
You do not need a paid tool to start. Free checkers like MxToolbox or Google’s Admin Toolbox will read your current SPF, DKIM, and DMARC records and tell you what is missing or malformed. Run your domain through one before you change anything. Often the records are there but one has a typo, an old include, or a policy that was set to p=none years ago and never moved, which means it has been mailing reports to an inbox nobody reads.
When to hand it off
If you run a single mailbox on Google Workspace, you can do all three yourself in an afternoon, and you should. Where it gets fiddly is a real mail server. We set up SPF, DKIM, and DMARC on Postfix and panel-based mail as part of our mail setup for self-hosted servers, and when deliverability is already broken and you need it diagnosed fast, that is what the email deliverability fix is for. The broader email deliverability service covers the picture underneath these three records too, including reverse DNS and IP reputation. On Google Workspace or Microsoft 365, our hosted email setup handles the same records on the provider side.
Records aside, the bigger upstream decision is whether to self-host email at all or rent mailboxes from a provider whose IPs already have a reputation.
If you read nothing else: turn them on in order, sit at p=none until the reports are clean, and never jump straight to reject. The records are simple. The rollout is where the patience pays off.
If mail is already failing and you are holding a rejection notice, work backwards instead: our walkthrough on decoding an email bounce back maps each SMTP status code to the record that needs fixing.
Common questions
Do I need all three: SPF, DKIM and DMARC?
Yes. Gmail and Yahoo require all three from anyone sending more than 5,000 messages a day to their users, and expect at least SPF or DKIM from everyone else. Each covers a gap in the others, and DMARC is the only one that tells receivers what to do with mail that fails.
How do I set up SPF, DKIM and DMARC?
Get the SPF include and the DKIM key from each service that sends as your domain, publish one SPF record listing all of them, publish each DKIM key and switch signing on, then add DMARC at p=none with a report address. Tighten the policy only after the reports show every legitimate sender passing.
Which DMARC policy should I use?
Start at p=none, move to p=quarantine once the reports are clean, and finish at p=reject. Reject gives the most protection against spoofing, but only after every service that sends as you passes.
Why is my email still going to spam with all three set?
Usually alignment (a sender passes for its own domain, not yours), a second SPF record or more than ten lookups, or a reputation problem that records cannot fix: a blocklisted IP, missing reverse DNS, or content that gets reported as spam.
Next in the journal
- 27 Jun 2026 How to migrate from shared hosting to a VPS in 2026 Most guides on this topic are really ads for one host’s one-click migrator. They walk you through their panel, skip the parts that actually…
- 26 Jun 2026 CyberPanel vs cPanel: an operator’s verdict, not a feature table Most CyberPanel vs cPanel comparisons are the same table: cost, web server, interface, ecosystem. Every row is accurate and none of it tells you…