SPF, DKIM and DMARC explained (with examples)
SPF, DKIM and DMARC explained with real record examples: what each checks, how alignment works, what changed in the 2026 DMARC standard and how to roll out a policy.
· 5 min read · By Reda El Kasraoui

TL;DR: SPF lists the servers allowed to send for the envelope (bounce) domain. DKIM signs each message with a key whose public half sits in your DNS. DMARC ties them to the address people see: it passes when SPF or DKIM passes for a domain aligned with the From domain, and tells receivers what to do when neither does (p=none, quarantine or reject). Publish one SPF record, sign with DKIM on your own domain, start DMARC at p=none, then tighten. Since May 2026 the DMARC standard is RFC 9989.
These three records are the basis of the bulk sender requirements at Gmail, Yahoo and Microsoft. This guide explains how they work, with examples you can adapt; to check your own domains, see the email authentication check.
The three records in one table
| SPF | DKIM | DMARC | |
|---|---|---|---|
| Checks | The sending server's IP | A signature over headers and body | That SPF or DKIM passed for the From domain |
| Domain it looks at | Envelope sender (Return-Path) | The d= domain in the signature | The visible From domain |
| Where it lives | TXT at the envelope domain | TXT at selector._domainkey.domain | TXT at _dmarc.domain |
| Standard | RFC 7208 | RFC 6376 | RFC 9989 |
SPF: which servers may send
An SPF record is a TXT record that starts with v=spf1 and lists who may send. A typical one for a domain that sends through one provider and its own server:
bounce.example.com. TXT "v=spf1 include:_spf.provider.example ip4:203.0.113.25 -all"
include:pulls in the provider's list of servers.ip4:authorizes one address you run yourself.-allfails everything else;~all(softfail) is the cautious variant.
Two rules cause most SPF failures. A domain may publish only one SPF record, and evaluation may trigger at most 10 DNS lookups (RFC 7208, section 4.6.4); each include, a, mx and redirect counts. Exceed it and SPF returns a permanent error.
SPF checks the envelope sender, not the From address. If your provider uses its own bounce domain, SPF passes for the provider, not for you. That's why a custom MAIL FROM subdomain such as bounce.example.com matters.
DKIM: a signature on every message
DKIM adds a DKIM-Signature header to each message. Shortened, it looks like this:
DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=s2026;
h=from:to:subject:date:message-id; bh=…; b=…
d= is the signing domain and s= the selector. The receiver fetches the public key at s2026._domainkey.example.com:
s2026._domainkey.example.com. TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkq…"
If the body or a signed header changed in transit, the signature fails. Google asks for keys of at least 1024 bits and recommends 2048. Selectors let you rotate keys: publish a new selector, switch signing, then remove the old record. Sign with your domain, not only the provider's default; that's what carries your reputation.
DMARC: alignment and policy
DMARC is published at _dmarc under your From domain. A first record:
_dmarc.example.com. TXT "v=DMARC1; p=none; rua=mailto:…"
The rua tag takes a mailto: address where receivers send daily aggregate reports; use a mailbox or reporting service you control.
Alignment is the core idea. DMARC passes if at least one of these is true:
- SPF passes and the envelope domain matches the From domain.
- DKIM passes and the
d=domain matches the From domain.
"Matches" is relaxed by default (adkim=r, aspf=r): bounce.example.com aligns with example.com. Strict mode (s) requires the exact same domain.
| From | SPF domain | DKIM d= | DMARC |
|---|---|---|---|
| news.example.com | bounce.example.com (pass) | example.com (pass) | Pass, both aligned |
| news.example.com | provider.example (pass) | example.com (pass) | Pass through DKIM |
| news.example.com | provider.example (pass) | provider.example (pass) | Fail: nothing aligned |
The third row is the classic surprise: everything "passes", yet DMARC fails because neither domain is yours.
Policies: p=none only monitors, p=quarantine asks receivers to treat failing mail as suspicious (usually the spam folder), p=reject asks them to refuse it. sp= sets the policy for subdomains.
What changed in the 2026 DMARC standard
In May 2026 the IETF published RFC 9989 (core), RFC 9990 (aggregate reports) and RFC 9991 (failure reports), replacing RFC 7489. The summary from dmarc.org lists the changes that affect senders:
- The
pct,rfandritags are deprecated, so a "pct=10" ramp is no longer the way to roll out a policy. - A new
np=tag sets the policy for subdomains that don't exist. - The organizational domain is found with a DNS tree walk instead of the Public Suffix List.
- DMARC's SPF check uses only the MAIL FROM domain, with no fallback to the HELO name.
Existing records with pct keep working in practice, but plan new rollouts without it.
A safe rollout, in order
- List every service that sends as your domain: providers, CRM, support desk, billing.
- Give each one DKIM on your domain and, where possible, a custom MAIL FROM so SPF aligns too.
- Publish one SPF record under 10 lookups for each envelope domain.
- Publish DMARC with
p=noneand a reporting address; read the reports for a few weeks. - When legitimate mail passes in alignment, move to
p=quarantine, thenp=reject. Addnp=rejectif you don't send from random subdomains. - Recheck after every DNS change and every new sending service.
Authentication proves who you are; it doesn't make mail wanted. Complaints, list quality and links still decide placement, as the guide to affiliate emails going to spam explains.
How Inspiremail helps
Inspiremail checks SPF, DKIM, DMARC, MX and custom MAIL FROM for every sending domain of your connected providers, scores each domain and shows the exact record to publish, with DMARC guidance per domain. When the zone sits in a connected DNS account, the record can be added for you. Each sender also gets its own tracking hostname, with the DNS record added for you (tracking domains explained). See the deliverability toolkit and the deliverability overview.
How we checked this guide
The definitions and limits come from the RFCs, Google's sender guidelines and dmarc.org's summary linked above, read on 1 December 2026; the records use reserved example domains and documentation IP addresses. If something here no longer matches, contact us and we'll correct it, as our editorial policy describes.
Frequently asked questions
Do I need all three: SPF, DKIM and DMARC?
For bulk mail, yes. Google requires senders of 5,000 or more messages a day to Gmail to publish SPF, DKIM and DMARC, and Yahoo and Microsoft set similar rules. Even below that volume, DKIM plus a DMARC record is what lets mailbox providers tie your reputation to your own domain.
What is DMARC alignment?
DMARC passes when SPF or DKIM passes for a domain that matches the visible From domain. In relaxed mode, the default, a subdomain counts as a match: mail.example.com aligns with example.com. In strict mode the domains must be identical.
Can a domain have two SPF records?
No. A domain must publish a single SPF record. Two records starting with v=spf1 make SPF return a permanent error. Merge the mechanisms into one record and keep it within the limit of 10 DNS lookups.
Which DMARC policy should I start with?
Start with p=none and a reporting address so you can see every source sending as your domain. When all legitimate mail passes in alignment, move to p=quarantine and then p=reject. Note that the pct tag is deprecated in the 2026 DMARC standard.
What changed with RFC 9989?
RFC 9989, published in May 2026, replaces RFC 7489 as the DMARC standard. It replaces the Public Suffix List with a DNS tree walk, deprecates the pct, rf and ri tags, adds np for non-existent subdomains and makes DMARC use only the MAIL FROM domain for SPF.
- SPF, DKIM and DMARC explained
- spf record example
- dkim signature
- dmarc record
- dmarc alignment
- email authentication