- SPF lists the servers allowed to send mail for your domain; DKIM signs each message with a key published in DNS.
- DMARC passes only when SPF or DKIM passes for a domain that matches the visible From address, and it tells receivers what to do with mail that fails.
- Roll DMARC out in stages: monitor with p=none, fix every legitimate sender, then move to quarantine and reject.
E-mail has no built-in proof of who sent it: the From line is just text. SPF, DKIM and DMARC are three standards, published in DNS, that let receiving servers check whether a message claiming to come from your domain really does. Large mailbox providers now expect them: since 2024, Gmail and Yahoo require bulk senders to publish SPF, DKIM and a DMARC record, and Microsoft announced similar rules for Outlook.com in 2025.
What SPF, DKIM and DMARC each prove
| Standard | Published at | What it checks | What a pass proves |
|---|---|---|---|
| SPF (RFC 7208) | example.com TXT v=spf1 … | Whether the sending server’s IP address is allowed for the envelope sender (Return-Path) domain | This server may send for that envelope domain |
| DKIM (RFC 6376) | selector._domainkey.example.com TXT v=DKIM1; p=… | A signature over the headers and body, made with the key named by the d= and s= tags | The signing domain took responsibility, and the signed parts were not changed |
| DMARC (RFC 9989) | _dmarc.example.com TXT v=DMARC1; p=… | Whether SPF or DKIM passed for a domain aligned with the header From | The visible sender domain is backed by a check |
SPF alone has two gaps: it checks the envelope sender, which recipients never see, and it breaks when mail is forwarded, because the forwarding server is not on your list. DKIM survives forwarding as long as the signed content is not changed, but it says nothing about the From address either. DMARC closes both gaps by tying the checks to the address people actually read.
Alignment: the part people miss
DMARC passes if at least one of these is true:
- SPF passes, and the envelope sender domain aligns with the From domain.
- DKIM passes, and the signing domain (
d=) aligns with the From domain.
In relaxed mode, the default, aligned means the same organizational domain, so mail.example.com aligns with example.com. In strict mode (aspf=s or adkim=s), the names must match exactly. The classic failure is a sending service that uses its own domains:
From: Example News <news@example.com>
Return-Path: <bounce-7731@mail.sender-platform.example>
DKIM-Signature: v=1; a=rsa-sha256; d=sender-platform.example; s=s1; ...
Authentication-Results: mx.receiver.example;
spf=pass smtp.mailfrom=mail.sender-platform.example;
dkim=pass header.d=sender-platform.example;
dmarc=fail header.from=example.comThe fix is in the service’s settings: DKIM signing with d=example.com, or a bounce domain under yours.
Reading a DMARC record
_dmarc.example.com. TXT "v=DMARC1; p=quarantine; sp=reject; rua=mailto:dmarc@example.com"| Tag | Meaning | Values |
|---|---|---|
v | Version; must come first | DMARC1 |
p | Policy for the domain itself | none (monitor only), quarantine (treat as suspicious, usually the spam folder), reject (refuse the message) |
sp | Policy for subdomains that exist; without it, p applies | none, quarantine, reject |
np | Policy for subdomains that do not exist; without it, sp or else p applies | none, quarantine, reject |
rua | Where receivers send aggregate reports, usually daily | One or more mailto: addresses |
t | Test mode: t=y asks receivers not to apply your policy in full; expect failing mail to be handled one level lower (reject as quarantine, quarantine as none) | y or n; default n |
adkim, aspf | Alignment mode for DKIM and SPF | r (relaxed, default) or s (strict) |
If the rua address is on another domain, such as a reporting service, that domain must publish a record authorizing it, for example example.com._report._dmarc.reports.example.net. Note that DMARC was revised in May 2026: RFC 9989 replaces RFC 7489, adds np and t, and removes pct, the percentage tag many older guides use for gradual rollouts. Receivers adopt the changes at their own pace, so move between policies in steps rather than relying on pct.
Rolling out DMARC safely
- List every service that sends as your domain: your mail platform, and also marketing, CRM, support desk, invoicing, HR and recruiting tools, website forms, monitoring alerts and scanners. The list is usually longer than expected.
- Publish SPF and turn on DKIM for each sender, signing with your own domain wherever the service supports it.
- Publish
p=nonewith anruaaddress. Nothing is blocked yet; receivers start sending reports that list every source of mail using your domain and whether it passed. - Read the reports for several weeks, long enough to catch monthly senders such as invoicing or payroll, and fix each legitimate source until it passes with alignment. Prefer DKIM, which survives forwarding.
- Move to
p=quarantine, keep reading the reports, then move top=rejectonce only unknown or malicious sources fail. With receivers that support RFC 9989, you can publish each new policy witht=yfirst, so it is applied one level lower while you watch the reports. - Keep a process: new tools that send mail must be set up for DKIM or SPF before they go live.
Common mistakes
- Two SPF records. A domain may publish only one
v=spf1record; two produce a permanent error, so SPF stops passing. Merge them. - More than 10 DNS lookups. SPF allows at most 10 terms that need a DNS lookup (
include,a,mx,ptr,existsandredirect), counting nested includes. Beyond that, SPF returns a permanent error. +allor?all. The first authorizes every server on the internet; the second says nothing. End with~allor-all.- Third-party senders without DKIM, or signing with their own domain, as in the example above.
- DMARC in the wrong place. The record belongs at
_dmarc.example.com, and there must be only one. - Jumping straight to
p=reject, so a forgotten sender stops delivering and nobody notices until a customer complains. - Old DKIM keys. Use 2048-bit RSA keys where your provider allows it, and rotate them.
v=spf1 ip4:192.0.2.10 include:_spf.mail-platform.example include:send.crm.example a mx ~allSubdomains and parked domains
Attackers spoof the names you do not watch: an unused subdomain, or a domain you registered defensively and never used for mail. Subdomains follow your main policy unless you set sp (and np for names that do not exist), so you can protect them early with sp=reject while the main domain is still at none. A subdomain that does send mail can publish its own DMARC record. A domain that never sends or receives mail should say so:
parked-example.com. TXT "v=spf1 -all"
_dmarc.parked-example.com. TXT "v=DMARC1; p=reject; sp=reject"
parked-example.com. MX 0 .The last line is a null MX record (RFC 7505), which tells senders the domain accepts no mail. Add an rua address if you want reports about spoofing attempts.
How to check your records
dig +short TXT example.com | grep -i "v=spf1" # exactly one SPF record
dig +short TXT _dmarc.example.com # the DMARC policy
dig +short TXT selector1._domainkey.example.com # a DKIM key, if you know its selector
dig +short MX example.com # where your mail is receivedDKIM is the one you cannot fully check from outside: selectors are not listed anywhere, so you must know which name to ask for. Open the headers of a message you sent, read the s= and d= tags of its DKIM-Signature header, and look at the Authentication-Results header the receiver added, which shows the SPF, DKIM and DMARC verdicts for that message.
_dmarc directly, so a published policy can be missed, and DKIM is not checked at all, so it always shows as unknown. Treat those two results as a prompt to check by hand, not as a verdict.What DMARC does not stop
- Lookalike domains.
examp1e.comis a different domain, and its owner can publish perfect records of their own. See lookalike domain detection. - Display-name spoofing. “Example Support” with a webmail address passes every check, because the address is not yours.
- Compromised accounts. Mail sent from one of your real mailboxes passes, because it is real; leaked credentials are often how that starts (see infostealer logs).
- Receivers that apply their own policy. DMARC is a request; each receiver decides what to do with it.
DMARC is still worth doing: it takes exact-domain spoofing off the table and shows you who sends mail as you. It just needs company: lookalike monitoring, user awareness and well-protected accounts.
Frequently asked questions
Do I need SPF, DKIM and DMARC, or is one enough?
You need all three. SPF and DKIM each authenticate part of a message, and DMARC ties them to the From address people see and tells receivers what to do when the check fails. Large mailbox providers also require them from bulk senders.
Should my SPF record end in -all or ~all?
Both are acceptable. -all asks receivers to treat other sources as failing, ~all as suspicious. Once DMARC is at quarantine or reject, DMARC makes the decision, and many administrators keep ~all so that a receiver rejecting on an SPF failure alone does not drop forwarded mail that DKIM would have passed.
How long should we stay at p=none?
Until the aggregate reports show every legitimate sender passing with alignment. Plan for several weeks, long enough to cover monthly senders such as invoicing or payroll, then move to quarantine and later to reject.
Why does DMARC fail when SPF and DKIM pass?
Because of alignment. DMARC needs SPF or DKIM to pass for a domain that matches the From address. Third-party services often pass SPF and DKIM for their own domain; set them up to sign with your domain, or to use a bounce domain of yours.
Does Scanbe4 check SPF, DKIM and DMARC?
Scanbe4 reports whether an SPF record is published, shows it, and flags changes to it between scans. Its DMARC and DKIM results are not reliable today, so check those two by hand with the commands in this article.
Want to see what your domains expose, from DNS records to certificates? Request a demo.
- Brand protection — lookalike domains and listings of your own hosts
- Reading findings — configuration checks and how they are reported
- Glossary — SPF, DKIM, DMARC and related terms
Filed under Email security · DNS · Brand protection