# 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.

Published 2026-12-01 by Reda El Kasraoui, Founder of Inspiremail. Canonical page: https://inspiremail.io/blog/spf-dkim-dmarc-explained

**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](https://inspiremail.io/blog/gmail-yahoo-bulk-sender-checklist) 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](https://inspiremail.io/blog/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](https://www.rfc-editor.org/rfc/rfc7208) | [RFC 6376](https://www.rfc-editor.org/rfc/rfc6376) | [RFC 9989](https://www.rfc-editor.org/rfc/rfc9989.html) |

## 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:

```text
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.
- `-all` fails 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](https://www.rfc-editor.org/rfc/rfc7208#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:

```text
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`:

```text
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](https://support.google.com/a/answer/81126). 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:

```text
_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:

:::steps
1. SPF passes **and** the envelope domain matches the From domain.
2. 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](https://www.rfc-editor.org/rfc/rfc9989.html) (core), RFC 9990 (aggregate reports) and RFC 9991 (failure reports), replacing RFC 7489. The [summary from dmarc.org](https://dmarc.org/2026/05/ietf-publishes-updated-dmarc-specification/) lists the changes that affect senders:

- The `pct`, `rf` and `ri` tags 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

:::steps
1. List every service that sends as your domain: providers, CRM, support desk, billing.
2. Give each one DKIM on your domain and, where possible, a custom MAIL FROM so SPF aligns too.
3. Publish one SPF record under 10 lookups for each envelope domain.
4. Publish DMARC with `p=none` and a reporting address; read the reports for a few weeks.
5. When legitimate mail passes in alignment, move to `p=quarantine`, then `p=reject`. Add `np=reject` if you don't send from random subdomains.
6. 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](https://inspiremail.io/blog/affiliate-emails-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](https://inspiremail.io/blog/tracking-domains-explained)). See the [deliverability toolkit](https://inspiremail.io/features/deliverability-toolkit) and the [deliverability overview](https://inspiremail.io/deliverability).

## 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](https://inspiremail.io/contact) and we'll correct it, as our [editorial policy](https://inspiremail.io/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.
