How SPF, DKIM and DMARC work together
Email has two sender addresses. The envelope sender (MAIL FROM) is used between servers and receives bounces. The header From is the one people see. Nothing in basic email requires them to match or to be true, and business email compromise (BEC) depends on that gap. A message can appear to come from your chief executive while its envelope names a server in another country.
| Standard | What it checks | What it misses alone |
|---|---|---|
| SPF | Whether the sending server may use the envelope domain | The visible From address, and forwarding |
| DKIM | A signature over the message by some domain | Whether that domain matches the From address |
| DMARC | Whether SPF or DKIM passed for a domain that aligns with the From address | Look-alike domains and compromised accounts |
DMARC connects the other two to the address people see. A message passes if at least one of them passes and aligns. DMARC also tells receivers what to do with failures and where to send reports, which is how you find out who is sending as your domain.
This page builds SPF and DMARC. DKIM needs a key pair, so your mail provider generates it and gives you the record to publish. Set up DKIM as well. It survives forwarding, which SPF does not.
The 10-lookup limit and the PermError trap
To protect receivers, RFC 7208 limits an SPF evaluation to 10 terms that cause DNS queries. At the eleventh, the result is PermError and SPF stops passing for all of your mail. Nothing warns you, and delivery may fail only at receivers that enforce the limit.
| Counts toward 10 | Does not count |
|---|---|
include, a, mx, ptr, exists, redirect | ip4, ip6, all, exp |
The trap is nesting. Every include brings in another record, and lookups inside it count as well. When checked in
November 2026, Mailgun's include used 5 of the 10 by itself, and SendGrid and Zoho used 2 each. A record with five visible
includes can already be over the limit. Providers change their records without telling you, so a record that worked last
year can break today. The counter shows the exact number in your record and an estimate with the nested lookups of listed services.
- Remove services you no longer use. Old marketing tools are the most common waste.
- Drop
aandmxunless those servers really send mail. - Use a subdomain per service, such as
news.example.com. Each name has its own limit. - Be careful with flattening. Replacing includes with addresses saves lookups, but breaks when the provider changes them.
Two other limits matter. Receivers should allow only two lookups that return nothing. A single TXT string holds at most 255 characters, so a longer record is split into several quoted strings that receivers join without spaces. The BIND and Cloudflare exports do this for you.
Rolling out DMARC in phases
- Monitor. Publish
p=nonewith aruaaddress. Nothing is blocked. Read aggregate reports for several weeks, long enough to cover monthly invoices and quarterly mailings. - Fix. For each legitimate sender that fails, set up DKIM with your domain or a custom MAIL FROM domain so that it aligns.
- Quarantine. Move to
p=quarantine, so that failing mail goes to spam.t=yasks receivers that support RFC 9989 to apply one level weaker while you watch the reports. Older receivers ignore it and apply the full policy. - Reject. When the reports are clean, publish
p=reject. Check thatspandnpare not weaker. - Keep reading reports. New services appear without anyone telling the mail team.
v=DMARC1; p=none; rua=mailto:dmarc@example.com
v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com; t=y
v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com
v=DMARC1; p=reject; rua=mailto:dmarc@example.com Mailing lists that modify messages break DKIM, and forwarding breaks SPF. Domains whose people post to lists should study the reports with care before they choose reject.
What changed in RFC 9989
DMARC became a standards-track protocol in May 2026, when RFC 9989 replaced RFC 7489. It retires pct, because
receivers applied percentages inconsistently, together with ri and rf. It adds t for testing,
np for subdomains that do not exist, and psd for public suffix operators. A missing p is now
read as p=none, and size limits on report addresses are obsolete. Existing v=DMARC1 records remain
valid. Both generations of receivers will coexist for years, so the validator explains what each one does.
Relaxed and strict alignment
Alignment compares the domain that passed SPF or DKIM with the domain in the From address. Relaxed, the default,
accepts any name under the same organizational domain, so mail.example.com aligns with example.com.
Strict requires an exact match.
| From address | Domain that passed | Relaxed | Strict |
|---|---|---|---|
| example.com | example.com | Aligned | Aligned |
| example.com | bounce.example.com | Aligned | Not aligned |
| news.example.com | example.com | Aligned | Not aligned |
| example.com | vendor-mail.net | Not aligned | Not aligned |
Relaxed suits almost everyone, because services commonly send bounces from a subdomain. Strict makes sense when subdomains are run by people you do not fully trust.
Publishing the records
- SPF is a TXT record at the domain itself, shown as
@in many dashboards. - DMARC is a TXT record at
_dmarc. Some dashboards add the domain for you, so do not type it twice. - Reports to another organization need that domain's permission. It publishes a TXT record under
_report._dmarc, and the builder shows the exact name. - Aggregate reports are XML and arrive daily, so use a dedicated mailbox or a processing service. Failure reports can contain personal data, and few receivers send them.
- For a domain that sends no mail, publish
v=spf1 -allandv=DMARC1; p=reject.
Can I have two SPF records?
No. Two records that begin with v=spf1 on one name are a permanent error. Merge the mechanisms into a single record with one all at the end. A long record is still one record: the TXT value is split into several quoted strings, which receivers join together.