SPF, DKIM and DMARC explained

Diagram of SPF DKIM DMARC checks a message passes before the inbox

SPF, DKIM and DMARC are three DNS records that prove an email really comes from the domain it claims. SPF lists the servers allowed to send for a domain, DKIM adds a digital signature to each message, and DMARC tells receiving servers what to do when both checks fail. Together they are called email authentication, and Gmail, Yahoo and Outlook now require them from bulk senders.

Each record covers a gap the others leave open, which is why one alone is not enough. This guide explains what each one does, how they connect, and the order to set them up without blocking your own mail.

What are SPF, DKIM and DMARC, in one table?

The three records answer three different questions about a message. The table shows what each one checks and where it lives.

SPF DKIM DMARC
Full name Sender Policy Framework DomainKeys Identified Mail Domain-based Message Authentication, Reporting and Conformance
Question it answers Did this message come from a server the domain allows? Was this message signed by the domain, and is it unchanged? Does the domain that passed match the From line, and what if not?
Standard RFC 7208 RFC 6376 RFC 7489
DNS location TXT record on the domain TXT record at selector._domainkey TXT record at _dmarc
What it checks The hidden envelope sender A signature in the message header The visible From domain
Survives forwarding No Yes, if the message is unchanged Depends on SPF or DKIM

The key detail is in the fifth row. SPF and DKIM each check a domain the reader never sees. Only DMARC ties the result to the From address a person actually reads.

How does SPF work?

SPF works by publishing a list of approved sending servers in DNS. When a message arrives, the receiving server reads the envelope sender, looks up that domain's SPF record, and checks whether the connecting IP address is on the list.

A typical record looks like this:

example.com.  TXT  "v=spf1 include:_spf.google.com include:sendgrid.net ~all"

It says: allow Google Workspace's servers, allow SendGrid's servers, and soft fail everything else. The ending matters. -all is a hard fail, ~all is a soft fail, and +all allows every server on the internet and should never be used.

SPF has three limits worth knowing:

  • One record only. Two SPF records on a domain return a permanent error.
  • 10 DNS lookups. Each include, a, mx, exists and redirect costs a lookup, including those nested inside an include. The 11th returns a permanent error.
  • It breaks on forwarding. A forwarding server is not on your list, so forwarded mail fails SPF.

The lookup limit is the fault we repair most. Check yours with the SPF record checker, which counts lookups through every include.

How does DKIM work?

DKIM works with a pair of cryptographic keys. Your sending service keeps the private key and uses it to sign each outgoing message. You publish the matching public key in DNS, and the receiving server uses it to verify the signature.

The signature travels in a header on the message:

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
  d=example.com; s=google; h=from:to:subject:date;
  bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=; b=AuUoFEfDxTDkHlLXSZEpZj79LICEps6eda7W3deTVFOk...

Two tags tell the receiver where to find the key. d= is the signing domain and s= is the selector, a name that picks one key among several. Here the key is at google._domainkey.example.com:

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

Because the signature covers the body and the listed headers, DKIM also proves the message was not altered in transit. That is why it survives forwarding when SPF does not.

Use a 2048-bit key. RFC 8301 sets 1024 bits as the minimum and recommends 2048. Each service that sends as your domain needs its own key and selector.

Separate selectors also let you replace one service's key without touching the others, which is how a key is rotated: publish the new key under a new selector, switch signing to it, then remove the old record a week later. Look one up with the DKIM checker.

How does DMARC work?

DMARC works by adding a rule on top of SPF and DKIM: at least one of them must pass, and the domain that passed must match the domain in the visible From line. That match is called alignment.

The record sits at _dmarc and holds a policy:

_dmarc.example.com.  TXT  "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com; pct=100"
Tag Meaning Values
p What to do with mail that fails none, quarantine, reject
rua Where to send daily aggregate reports A mailto: address
pct Share of failing mail the policy applies to 1 to 100
sp Policy for subdomains Same values as p
adkim, aspf How exact the domain match must be r relaxed, s strict

The three policies escalate. p=none delivers everything and only reports. p=quarantine sends failing mail to spam. p=reject refuses it at the door.

DMARC also gives you something the other two do not: reports. Every day, receivers send a summary of which servers sent mail as your domain and whether each passed. Those reports are how you find a forgotten billing tool, or a stranger sending as you. Look up any domain's policy with the DMARC checker.

What is alignment, and why do messages fail DMARC when SPF and DKIM pass?

Alignment means the domain that passed SPF or DKIM is the same as the domain in the From line. A message fails DMARC without it, even when both underlying checks pass.

This is the most misunderstood part of email authentication. Here is a real pattern from message headers:

Authentication-Results: mx.google.com;
  dkim=pass header.i=@mailplatform.example header.s=s1;
  spf=pass smtp.mailfrom=bounce.mailplatform.example;
  dmarc=fail (p=NONE) header.from=example.com

SPF passed for the platform's bounce domain. DKIM passed for the platform's signing domain. Neither is example.com, so DMARC fails.

Check Domain it verified Matches the From domain?
SPF bounce.mailplatform.example No
DKIM mailplatform.example No
DMARC example.com Fails: nothing aligned

The fix is in the sending platform, not in DNS alone. Turn on custom domain signing so DKIM signs with d=example.com, and set a custom return path so SPF checks a subdomain of yours. With relaxed alignment, the default, mail.example.com counts as a match for example.com.

Do you need all three?

Yes. Each record fails in a way that only another one covers, and the mailbox providers now require all three from anyone sending at volume.

As of November 15, 2026, these are the published rules:

Provider Applies to Requirement
Google All senders SPF or DKIM must pass
Google 5,000 or more messages a day SPF and DKIM, a DMARC record of at least p=none, and alignment
Yahoo Bulk senders SPF and DKIM, a DMARC record of at least p=none, and alignment
Microsoft More than 5,000 messages a day to Outlook.com, Hotmail and Live SPF and DKIM must pass, DMARC of at least p=none, aligned

Microsoft rejects mail that does not comply, with the error 550 5.7.515 Access denied, sending domain does not meet the required authentication level.

Small senders are not exempt in practice. A domain with no DMARC record can be forged by anyone, and unauthenticated mail is treated with more suspicion every year.

In what order should you set them up?

Set them up in the order SPF, DKIM, then DMARC at p=none, and only then tighten the policy. Publishing a strict DMARC policy first is how companies block their own invoices.

  1. List every sender. Mailboxes, marketing platform, CRM, billing, help desk, website forms. Each one sends as your domain.
  2. Publish one SPF record with every sender's include, ending in ~all. Confirm it stays within 10 lookups.
  3. Turn on DKIM in each service with a 2048-bit key and custom domain signing. Publish each key at its selector.
  4. Publish DMARC at p=none with an rua address. Nothing is blocked yet.
  5. Read the reports for at least 2 weeks. Fix alignment for every legitimate source that fails.
  6. Move to p=quarantine, starting at pct=25 and raising it to 100 over 2 to 4 weeks.
  7. Move to p=reject once no legitimate source has failed for 2 weeks.

Steps 1 and 5 take the longest and are skipped the most. In our work, the senders that cause trouble are the ones nobody remembered: a form plugin, an old invoicing tool, a regional office with its own newsletter.

What are the most common setup mistakes?

The most common mistakes are small, and each one makes a correct-looking setup fail. These are the eight we find most often on audits.

Mistake What happens Fix
Two SPF records on one domain SPF returns a permanent error for all mail Merge them into one record
More than 10 DNS lookups in SPF SPF returns a permanent error Remove unused includes or move a sender to a subdomain
SPF ending in +all Every server on the internet is authorized End with ~all or -all
DKIM turned on but the key never published Every signature fails Publish the key at the selector the service names
A line break pasted inside the DKIM key The key is invalid Paste the key as one unbroken value
The platform signs with its own domain DKIM passes, DMARC fails Turn on custom domain signing
DMARC with no rua address You get no reports and cannot see who fails Add a reporting address
p=reject published on day one Legitimate mail from forgotten senders is refused Start at p=none and read reports first

Every row here leaves mail "sending" as normal. The failure only shows in headers and reports, which is why these faults can sit unnoticed for months.

How do subdomains change the setup?

Subdomains inherit DMARC but not SPF or DKIM. A message from news.example.com is covered by the DMARC record on example.com unless the subdomain publishes its own, and the sp tag sets the policy for subdomains separately.

SPF does not inherit. Each subdomain that sends mail needs its own SPF record, and each has its own budget of 10 lookups. That is why moving a bulk sender to a subdomain is the cleanest fix for an SPF record that has run out of lookups. It also keeps the reputation of marketing mail apart from the mail your staff send by hand.

For a domain that sends no mail at all, publish v=spf1 -all and a DMARC record at p=reject. Parked domains are a favorite of forgers because nobody watches them.

Where do BIMI, MTA-STS and ARC fit?

BIMI, MTA-STS and ARC are three related standards that build on authentication. None of them replaces SPF, DKIM or DMARC.

Standard What it adds Depends on
BIMI Shows your logo beside your messages in supporting inboxes DMARC at p=quarantine or p=reject
MTA-STS (RFC 8461) Forces encrypted delivery of mail sent to your domain A policy file and a DNS record
ARC (RFC 8617) Lets a forwarder pass on the original authentication results The forwarder supporting it

BIMI is the one most senders ask about. It only works once DMARC is enforced, which makes it a visible reward for finishing the staged rollout above.

How do you check that all three are working?

Check all three by reading the headers of a real message, because DNS only shows what is published and not what your mail actually does. Send an email to a Gmail address, open it, and choose "Show original".

Gmail prints a summary at the top:

SPF:    PASS with IP 209.85.220.41
DKIM:   'PASS' with domain example.com
DMARC:  'PASS'

All three should say PASS, and the DKIM domain should be your own. Repeat the test from every service that sends as your domain, since each one authenticates separately.

For the DNS side, our free email deliverability test reads all three records at once, along with MX, MTA-STS and BIMI. On one engagement written up in our case studies, an audit of 36 domains found 57% passing authentication checks. After the records were standardized, 99% passed.

What do the three records not do?

They do not put your mail in the inbox. Authentication proves who sent a message, and nothing about whether people want it. A fully authenticated sender with a spam complaint rate above 0.3% will still land in spam.

They are the entry requirement. Reputation, list quality and sending pattern decide the rest. If your records pass and mail still lands in spam, that is the work our email deliverability audit covers.

Drafted with AI assistance from our own records and client work, then reviewed and approved by Kunal Arora. See our editorial policy.