1. Blog
  2. Domains and setup

SPF, DKIM and DMARC in plain English

What SPF, DKIM and DMARC actually do, with example records, how alignment works, which DMARC policy to use, and the mistakes that quietly break them.

  • The PeakPlanner team
  • 9 min read
On this page
  1. The problem these records solve
  2. SPF: which servers may send for you
  3. DKIM: a signature on every email
  4. DMARC: tying it to the From address
  5. Alignment, the part most people miss
  6. Choosing a DMARC policy, and reading the reports
  7. The mistakes that quietly break authentication
  8. A checklist for each sending domain
  9. How PeakPlanner handles this
  10. Questions people ask

Before Gmail or Outlook decides whether your email deserves the inbox, it asks a more basic question: is this email really from who it says it’s from? Three DNS records answer that question. Get them right and you’ve cleared the first hurdle. Get them wrong and nothing else you do, from warmup to careful lists to good writing, fully makes up for it. (Email deliverability, explained covers everything else a filter weighs.)

The names make them sound harder than they are. This guide explains what each record does, with example records you can adapt, how the three fit together through alignment, how to choose and tighten a DMARC policy, and the handful of simple mistakes that cause the usual authentication failures.

Gmail and Outlook.com now require all three from anyone sending more than 5,000 emails a day to their users, and every sender is better off with them. For the rules themselves, see Gmail and Yahoo’s sender rules.

The problem these records solve

Email was designed for a more trusting world. Anyone can type any address into the From line, the same way anyone can write any return address on an envelope. Receiving servers need a way to check, and they need it to be automatic, because no person could check each one.

Each record checks something different:

  • SPF checks the server: is this machine allowed to send email for this domain?
  • DKIM checks the message: was it signed by the domain, and has it been changed since?
  • DMARC checks the match: does what SPF or DKIM verified line up with the From address the reader actually sees, and what should happen if it doesn’t?

All three live in DNS, the public directory for your domain, which is why only the domain’s owner can set them up. The examples below use a made-up sending domain, getacme.com, on Google Workspace, with notes for Microsoft 365. If you haven’t picked a provider yet, see Google Workspace or Microsoft 365 for cold email mailboxes.

SPF: which servers may send for you

SPF (Sender Policy Framework) is a TXT record that lists the servers allowed to send email for your domain. When an email arrives, the receiver looks at the domain in the hidden envelope sender (also called the Return-Path or MAIL FROM) and checks whether the sending server is on that domain’s list.

An SPF record for a domain on Google Workspace looks like this:

  • Type: TXT
  • Host: @ (the domain itself)
  • Value: v=spf1 include:_spf.google.com ~all

Read it left to right. v=spf1 says this is an SPF record. include:_spf.google.com says “also allow every server Google lists”. ~all says “treat anything else as suspicious”, which is called a soft fail. On Microsoft 365, the include is spf.protection.outlook.com instead.

-all, a hard fail, is stricter, and some receivers act on it directly. Many admins use ~all and let DMARC decide what happens to failures. What matters far more is never using +all, which allows every server on the internet to send as you.

SPF has two weak spots. It checks the envelope domain, not the From address the reader sees. And it breaks when an email is forwarded, because the forwarding server isn’t on your list. Both are why SPF alone isn’t enough.

DKIM: a signature on every email

DKIM (DomainKeys Identified Mail) adds a digital signature to every email you send. Your email provider signs each message with a private key it keeps secret. You publish the matching public key in DNS. The receiver uses that public key to check the signature. If the email was altered on the way, or wasn’t signed by someone holding your key, the check fails.

The public key lives at a name made of a selector, then ._domainkey, then your domain. The selector lets one domain have several keys, for example one per service that sends for it. On Google Workspace the default selector is google:

  • Type: TXT
  • Host: google._domainkey
  • Value: v=DKIM1; k=rsa; p=MIIBIjANBgkqh… (a long key Google generates for you)

In Google Workspace you generate the key in the Admin console (Apps, Google Workspace, Gmail, Authenticate email), publish it at your DNS host, then go back and click Start authentication. Google recommends a 2048-bit key where your DNS host supports it. Microsoft 365 works differently: you publish two CNAME records, selector1._domainkey and selector2._domainkey, pointing at keys Microsoft hosts, then turn signing on in the Microsoft Defender portal.

DKIM survives forwarding, because the signature travels inside the message. That makes it the more dependable of the two for DMARC.

DMARC: tying it to the From address

DMARC (Domain-based Message Authentication, Reporting and Conformance) does two jobs. It requires SPF or DKIM to pass for a domain that matches the From address, the one the reader sees. And it lets you tell receivers what to do when that fails, and ask them to send you reports.

A starting DMARC record looks like this:

  • Type: TXT
  • Host: _dmarc
  • Value: v=DMARC1; p=none; rua=mailto:dmarc-reports@getacme.com

v=DMARC1 marks the record. p=none is the policy: take no action, just report. rua is the address that daily summary reports go to.

Alignment, the part most people miss

An email can pass SPF and pass DKIM and still fail DMARC. That happens when the domains those checks verified aren’t the domain in the From line.

Say you send from anna@getacme.com through a service that uses its own bounce address and signs with its own domain. SPF passes, for the service’s domain. DKIM passes, with a signature from the service’s domain. Neither is getacme.com, so DMARC fails.

DMARC passes when at least one of these is true:

  • SPF passes, and the envelope sender’s domain matches the From domain.
  • DKIM passes, and the domain in the signature (the d= value) matches the From domain.

By default the match is relaxed: mail.getacme.com counts as matching getacme.com, because they share the same registered domain. Strict alignment, set with adkim=s and aspf=s, demands an exact match, and you rarely need it.

The practical rule: make sure DKIM signs with your own sending domain. If your mailboxes are on Google Workspace or Microsoft 365, setting up DKIM for the domain does exactly that.

How to check

Send an email from your sending mailbox to a Gmail address, open it, and choose “Show original” from the message menu. The top of the page lists the SPF, DKIM and DMARC results. All three should say PASS, and the DKIM line should name your sending domain, not your provider’s. To check where your emails land, not just whether they authenticate, see inbox placement tests.

Choosing a DMARC policy, and reading the reports

The three policies

  • p=none: take no action, just send reports. Where every domain should start.
  • p=quarantine: treat failing mail as suspicious, which in practice usually means the spam folder.
  • p=reject: refuse failing mail outright.

Reading the reports

With rua set, receivers that support DMARC send you aggregate reports, usually once a day: XML files listing which servers sent mail claiming to be your domain, how many messages, and whether each passed SPF, DKIM and alignment. They aren’t meant to be read raw. A DMARC report reader, and there are free ones, turns them into tables. You’re looking for three things:

  • Every source you recognize, such as your email provider, passes.
  • Nothing you don’t recognize is sending as your domain.
  • The failures you can explain, mostly forwarding, are small.

If rua points to an address on a different domain, that other domain has to publish a record agreeing to receive your reports. The simplest fix is a mailbox on a domain you control.

Moving up

On a domain used only for cold email, the path is short, because one provider sends for it and nothing else should. A sensible rule of thumb: start at p=none, check a week or two of reports, move to p=quarantine, check again, then move to p=reject. Gmail and Outlook.com only ask for p=none, so tightening is optional, but it stops anyone else sending as your domain.

The mistakes that quietly break authentication

Authentication rarely fails loudly. Mail keeps flowing, and the damage shows up later as worse placement. These are the usual causes.

Two SPF records

A domain must have exactly one SPF record. Add a second, say one for Google and one for a new tool, and the SPF standard tells receivers to return a permanent error, which counts as a failure. Merge them into one: v=spf1 include:_spf.google.com include:spf.example.com ~all.

More than 10 DNS lookups

SPF allows at most 10 terms that need a DNS lookup (include, a, mx, ptr and exists, plus the redirect modifier), counting the ones nested inside each include. Go over and SPF fails with a permanent error. One include for a large provider can use several lookups on its own. Remove services you no longer use. On a sending domain with a single provider, you’ll never get close.

Missing DKIM on a new provider

Moving a domain to a new email provider, or adding mailboxes on a second one, means a new DKIM setup. Microsoft 365 doesn’t DKIM-sign mail from a custom domain until you set it up, and Google Workspace won’t until you generate the key and click Start authentication. Mail still goes out, so nobody notices, but DMARC now rests on SPF alone, and SPF breaks on forwarding.

Smaller slips

  • A record on the wrong host: the DKIM key on @ instead of google._domainkey, or DMARC on @ instead of _dmarc.
  • A long DKIM key pasted with a stray space or line break in the middle.
  • An old provider left in SPF after you moved away, wasting lookups and still allowing servers you don’t use.
  • Testing too soon. DNS changes can take a while to spread, and Google notes DKIM can take up to 48 hours to start working.

A checklist for each sending domain

Run through this for every domain that sends, whether it’s your main domain or one of your sending domains:

  1. One SPF record, listing your email provider and nothing you don’t use.
  2. DKIM turned on in your provider, with the key published (2048-bit where your DNS host supports it).
  3. A DMARC record at _dmarc, starting at p=none with rua set to a mailbox you read.
  4. A test email to a Gmail address, with Show original saying PASS three times.
  5. A week or two of DMARC reports, then a tighter policy.
  6. A fresh check whenever you add a tool, change provider or move DNS hosts.

For everything else to have in place before the first send, see the cold email setup checklist. And remember what authentication does and doesn’t do: it proves who you are, but where you land after that depends on your sender reputation.

How PeakPlanner handles this

PeakPlanner orders your sending domains and mailboxes as soon as you pay, with the DNS records Gmail and Outlook check, and they’re usually ready a day or two later. They’re separate from your company’s own domain, so its records and its reputation stay exactly as they are. Each mailbox then warms up for 15 days on PeakPlanner’s own warmup network before it emails a single lead.

If you’d like that set up for you, see the pricing or tell us about your business.

Questions people ask

Do I really need all three?

Yes. Gmail requires SPF, DKIM and DMARC from anyone sending more than 5,000 emails a day to Gmail accounts, Outlook.com has similar rules, and smaller senders benefit too. The three cover each other’s gaps: SPF breaks on forwarding, DKIM doesn’t, and DMARC needs at least one of them to pass for your From domain.

Should my DMARC policy be p=reject?

Eventually, on any domain where you know every legitimate sender. Start at p=none, read the reports, and tighten once all your own mail passes. Jumping straight to reject can block your own email if you missed a source.

Does passing SPF, DKIM and DMARC get my email into the inbox?

No. Authentication proves the email is really from you; it doesn’t make anyone want it. It’s the entry ticket. Your reputation, your list and your emails decide where you land after that.

Should I use ~all or -all in SPF?

Either is fine once DMARC is in place. ~all marks unlisted servers as suspicious and leaves the decision to DMARC; -all says they’re not allowed, and some receivers act on that directly. Never use +all.

What is BIMI, and do I need it?

BIMI lets a brand’s logo appear next to its emails in some inboxes. It requires DMARC at quarantine or reject and, at Gmail, a certificate for the logo. It’s aimed at established brands sending marketing email; cold email sending domains don’t need it.

Get started

Want cold email that runs itself?

Tell us what you sell and who you want to reach. We’ll come back with a plan and a price.

Tell us about your business