SPF, DKIM and DMARC Explained: Setup Guide for 2026
SPF, DKIM and DMARC are three DNS records that let a receiving mail server check whether a message really comes from your domain. SPF lists the servers allowed to send for the domain, DKIM adds a cryptographic signature to every message, and DMARC tells the receiver what to do when neither check passes for the domain your reader sees in the From address. Gmail, Yahoo and Outlook.com require all three from anyone who sends around 5,000 or more messages a day to their users, and expect at least SPF or DKIM from everyone else.
p=none with a rua address for reports. Read the reports for a few weeks, fix every legitimate sender that fails alignment, then move to quarantine and reject. Since May 2026 DMARC is defined by RFC 9989: the pct, ri and rf tags are gone, and t=y is the new testing flag.What do SPF, DKIM and DMARC actually check?
Each record answers a different question. SPF asks whether the server that delivered the message is allowed to send for the envelope sender's domain, DKIM asks whether a domain signed the message and whether it arrived unchanged, and DMARC asks whether either of those passes was for the domain in the From header.
| Record | Published at (DNS name) | What it checks | Passes when |
|---|---|---|---|
| SPF | TXT at the envelope sender domain, e.g. example.com or bounce.example.com | The IP address of the server that connected | The IP matches a mechanism in the record |
| DKIM | TXT (or a CNAME to the provider's key) at selector._domainkey.example.com | A signature over chosen headers and the body | The signature verifies with the published public key |
| DMARC | TXT at _dmarc.example.com | Whether SPF or DKIM passed for a domain aligned with the From header | At least one aligned pass |
As of November 2026, DMARC per RFC 9989.
The domain that passed SPF (the envelope sender, also called Return-Path or MAIL FROM) or the domain that signed with DKIM (the d= value) matches the domain in the From header. In relaxed mode, the default, a subdomain counts: bounce.example.com aligns with example.com. In strict mode the names must be identical.
Alignment is the part most explanations skip, and it is the reason DMARC exists. SPF on its own checks only the envelope sender, which readers never see, and DKIM on its own checks only that some domain signed the message. A spammer can pass both for a domain they own while putting your domain in the From line. DMARC closes that gap: a pass counts only when it belongs to your domain.
How does SPF work, and what should your record look like?
An SPF record is a single TXT record that starts with v=spf1, lists the IP addresses and services allowed to send for the domain, and ends with a rule for every other server. The receiver looks up the record for the envelope sender's domain and compares it with the IP address of the connecting server.
example.com. 3600 IN TXT "v=spf1 ip4:203.0.113.25 include:_spf.google.com ~all"
ip4:andip6:authorise addresses or ranges, such as the IP of your own mail server.include:pulls in another domain's SPF record, the usual way to authorise a provider such as Google Workspace.aandmxauthorise the addresses of the domain's A or MX records.allat the end decides what happens to everyone else:-allfail,~allsoft fail,?allneutral.+alllets any server on the internet pass, so never use it.
Four rules from RFC 7208 cause most broken SPF records:
- One record per name. Two TXT records that both start with
v=spf1produce a permanent error, and SPF then fails for every message. Merge them into one. - At most 10 DNS lookups. Every
include,a,mx,ptr,existsandredirectcosts a lookup, and so do the ones nested inside included records. The eleventh produces a permanent error. The RFC also recommends a limit of two lookups that return nothing ("void lookups"). Our post on fixing the SPF "too many DNS lookups" error shows how to get back under the limit. - Do not use
ptr. The RFC says it should not be used: it is slow and unreliable. - SPF checks the envelope sender, not the From header. If a provider sends with its own bounce domain, SPF passes for the provider's domain and does nothing for your DMARC.
That last rule is why bulk providers let you set a custom bounce domain. With Amazon SES, for example, you publish an MX and an SPF record on a subdomain you choose, as AWS describes for a custom MAIL FROM domain:
bounce.example.com. 3600 IN MX 10 feedback-smtp.eu-central-1.amazonses.com.
bounce.example.com. 3600 IN TXT "v=spf1 include:amazonses.com ~all"
Messages from SES then carry bounce.example.com as the envelope sender, which aligns with example.com in relaxed mode. Our guide to setting up Amazon SES for a self-hosted newsletter walks through the rest of that setup.
💡 Tip: Many operators keep~alleven after DMARC is enforcing. A hard-allcan make some receivers reject a forwarded message on SPF alone, before DMARC has the chance to accept it on a valid DKIM signature.
How does DKIM sign your email?
The sending server signs selected headers and the body with a private key and adds a DKIM-Signature header; the receiver fetches the matching public key from DNS and checks that nothing was changed in transit. The header names the signing domain (d=) and a selector (s=) that tells the receiver where to find the key.
s1._domainkey.example.com. 3600 IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."
- Sign with your own domain. A provider that signs with
d=provider.netgives you a DKIM pass that does not align. Turn on the provider's custom-domain DKIM so thatd=is your domain or one of its subdomains. - One selector per service. Google Workspace, your newsletter server and your helpdesk can each sign with their own key, side by side, because each has its own selector.
- Key length. Gmail requires keys of at least 1024 bits and recommends 2048. A 2048-bit public key is longer than the 255 characters one TXT string can hold, so DNS panels store it as several quoted strings in one record; receivers join them back together.
- CNAME delegation. Some providers (Amazon SES Easy DKIM among them) ask you to publish CNAMEs that point to keys they host and rotate. The selectors are random tokens, so copy them exactly.
- Rotation. To replace a key, publish a new selector, switch signing to it, and remove the old record only after mail signed with it has been delivered.
What goes into a DMARC record? Every tag explained
A DMARC record is a TXT record at _dmarc. plus your domain. It starts with v=DMARC1, sets the policy with p and names an address for reports with rua; every other tag is optional.
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com"
| Tag | Values | If absent | What it does |
|---|---|---|---|
v | DMARC1 | Record ignored | Required, and must be the first tag |
p | none, quarantine, reject | Treated as none | Policy for mail that fails DMARC |
sp | same as p | p applies | Policy for subdomains |
np | same as p | sp, then p | Policy for subdomains that do not exist in DNS |
t | y, n | n | Testing: y asks receivers to apply one step less |
rua | comma-separated mailto: URIs | No aggregate reports | Where receivers send aggregate reports |
ruf | comma-separated mailto: URIs | No failure reports | Where receivers send per-message failure reports |
adkim | r, s | r (relaxed) | DKIM alignment mode |
aspf | r, s | r (relaxed) | SPF alignment mode |
fo | 0, 1, d, s | 0 | When failure reports are made; ignored without ruf |
psd | y, n, u | u | For registries and other public suffix operators; leave it out |
As of November 2026, per section 4.7 of RFC 9989.
What happened to pct, ri and rf?
RFC 9989 removed all three. pct asked receivers to apply the policy to a percentage of failing mail; the RFC notes that in practice values other than 0 and 100 were rarely applied accurately, so the useful part, pct=0, became the new t=y. ri requested an interval between aggregate reports (86400 seconds, one day, by default); receivers decide that themselves and usually report per UTC day. rf chose a failure report format that only ever had one value.
A record that still says pct=100 or ri=86400 keeps working, because receivers must ignore tags they do not know. Remove them the next time you edit the record, and replace pct=0 with t=y.
⚠️ Warning: A receiver that still implements only the older RFC 7489 does not knowtand applies yourpin full. Treatt=yas a hint for receivers that follow RFC 9989, not as a safe test mode everywhere.
Does DMARC cover subdomains?
Yes. p applies to the domain itself, sp to its subdomains and np to subdomains that do not exist at all, such as random-name.example.com, which spammers like because nobody watches them. A subdomain that publishes its own _dmarc record overrides the parent's policy for itself.
What changed in DMARC in 2026?
In May 2026 the IETF published RFC 9989, which replaces RFC 7489 from 2015 and RFC 9091, and moves DMARC from an informational document to the Standards Track. Aggregate reporting now has its own specification, RFC 9990, and failure reporting is in RFC 9991.
📌 Key takeaways
- Removed tags:
pct,riandrf. - Added tags:
t(testing),np(non-existent subdomains, carried over from RFC 9091) andpsd(public suffix domains). - Receivers find the organizational domain with a "DNS tree walk" through the parent names instead of the Public Suffix List.
- For most senders nothing breaks. Clean up the removed tags and consider
np=rejectonce you are at enforcement.
What do Gmail, Yahoo and Outlook require?
All three expect SPF or DKIM from every sender, and SPF, DKIM and an aligned DMARC record (at least p=none) from senders of about 5,000 or more messages a day.
| Provider | Who counts as a bulk sender | Authentication for bulk senders | Other requirements | Enforcement |
|---|---|---|---|---|
| Gmail (personal accounts) | Close to 5,000 or more messages in 24 hours, counted per primary domain; the status does not expire | SPF, DKIM and DMARC (p=none or stricter); From aligned with SPF or DKIM | PTR records, TLS, one-click unsubscribe, spam rate below 0.30% (target below 0.10%) | Since February 2024; from November 2025 temporary and permanent rejections |
| Yahoo | Volume not published | SPF and DKIM; DMARC at least p=none that passes; relaxed alignment accepted | One-click unsubscribe, unsubscribes honoured within 2 days, spam rate below 0.3% | Since February 2024 |
| Outlook.com, Hotmail, Live | Domains sending more than 5,000 messages a day | SPF and DKIM pass; DMARC at least p=none, aligned with SPF or DKIM | — | Since 5 May 2025 non-compliant mail goes to Junk; rejection announced with 550 5.7.515 |
As of November 2026. Sources: Google sender guidelines and FAQ, Yahoo sender requirements, Microsoft's requirements for high-volume senders.
Gmail's rules apply to mail sent to personal Gmail accounts, not to Google Workspace recipients. One-click unsubscribe means the List-Unsubscribe and List-Unsubscribe-Post headers of RFC 8058; our developer's guide to one-click unsubscribe covers the implementation.
How do you set up SPF, DKIM and DMARC step by step?
Start by listing every service that sends mail with your domain, publish SPF and DKIM for each, then add DMARC in monitoring mode and tighten it only after the reports show that all legitimate mail aligns.
- List your senders
Newsletter platform, transactional mail, Google Workspace or Microsoft 365, CRM, helpdesk, invoicing, website contact forms. Forgotten senders are the most common reason for failures after you enforce.
- Publish one SPF record
Add every sender to a single record and count the lookups. For providers that bounce through their own domain, set a custom bounce (MAIL FROM) subdomain or rely on DKIM for alignment.
- Turn on DKIM everywhere
Enable custom-domain signing in each service and publish its selector record (TXT or CNAME).
- Publish DMARC with p=none
v=DMARC1; p=none; rua=mailto:dmarc-reports@example.comcollects reports without changing delivery. Leave it for two to four weeks so that monthly mailings also show up. - Fix what fails
For every legitimate source in the reports that fails alignment, fix its SPF or DKIM, or stop it from using your domain.
- Enforce
Move to
p=quarantine, watch the reports again, then top=reject. Addspandnpif your subdomains do not send mail of their own. - Lock domains that never send
Parked and redirect-only domains get
v=spf1 -allandv=DMARC1; p=reject, so nobody can send in their name.
Check what the internet sees with dig, and check a real message in Gmail with Show original, which lists the SPF, DKIM and DMARC results:
dig +short TXT example.com # SPF (and other TXT records)
dig +short TXT s1._domainkey.example.com # DKIM public key for selector s1
dig +short TXT _dmarc.example.com # DMARC policy
For the wider picture of running your own sending, from IP reputation to bounce handling, see our guide to email deliverability on a self-hosted platform.
Why does DMARC fail when SPF and DKIM pass?
Because DMARC needs a pass for a domain aligned with the From header, and most failures are passes for someone else's domain. The table lists the cases that show up in reports most often; if Gmail is already bouncing your mail, start with our post on the Gmail 550-5.7.26 "unauthenticated" error.
| What you see | Cause | Fix |
|---|---|---|
| SPF pass, DMARC fail | The envelope sender is the provider's domain | Custom MAIL FROM subdomain, or DKIM with your domain |
DKIM pass for d=provider.net | The provider signs with its own domain | Turn on custom-domain DKIM |
| SPF permerror | Two SPF records, or more than 10 lookups | Merge the records, remove unused includes |
| Forwarded mail fails SPF | The forwarding server's IP is not in your record | DKIM normally survives plain forwarding; keep every stream DKIM-signed |
| Mailing-list posts fail DKIM | The list changes the subject or adds a footer | Lists commonly rewrite the From header to their own domain; nothing to fix on your side |
How do you read DMARC aggregate reports?
Receivers that support DMARC send gzip-compressed XML files to your rua address, typically one per UTC day, grouping your mail by source IP and authentication result. The format is defined in RFC 9990. One record looks like this (shortened):
<record>
<row>
<source_ip>198.51.100.10</source_ip>
<count>412</count>
<policy_evaluated>
<disposition>none</disposition>
<dkim>pass</dkim>
<spf>fail</spf>
</policy_evaluated>
</row>
<identifiers>
<header_from>example.com</header_from>
</identifiers>
<auth_results>
<dkim>
<domain>example.com</domain>
<selector>s1</selector>
<result>pass</result>
</dkim>
<spf>
<domain>amazonses.com</domain>
<result>pass</result>
</spf>
</auth_results>
</record>
Read it from the bottom up. SPF passed, but for amazonses.com, so policy_evaluated shows SPF as fail: it does not align with example.com. DKIM passed for example.com, which does align, so these 412 messages passed DMARC. If this source also lost DKIM, they would fail; a custom MAIL FROM domain gives you a second, independent pass.
ℹ️ Note: Sendruato a dedicated mailbox or a report-parsing service, not to a person. If the address is on another domain, that domain must publish an authorisation record (example.com._report._dmarc.example.net), otherwise receivers will not send to it.
How does NetSendo handle SPF, DKIM and DMARC?
NetSendo is self-hosted and sends through the provider you choose, so the records you publish are the ones of that provider and your own domain; NetSendo itself publishes no SPF include. What it adds is help with getting the records right and keeping them right:
- Deliverability Shield (GOLD plan, see pricing) checks the SPF, DKIM and DMARC records of every sending domain on a schedule and alerts you when one breaks.
- Its SPF generator keeps your current record and only adds the includes your sending providers need (it recognises Amazon SES, SendGrid, Google Workspace, Microsoft 365 and Mailgun), and warns about the lookup limit.
- Its DMARC generator starts with
p=noneand offersquarantineand thenrejectas the next steps, with relaxed alignment, noruf, and your existingruaaddress kept. - For providers with unguessable selectors, such as Amazon SES Easy DKIM, you can enter the selector so the DKIM check finds it.
- When you send through the built-in NetSendo MTA (also a GOLD feature), NetSendo creates a 2048-bit DKIM key for the mailbox's domain, shows the TXT record with Copy and Verify record, and gives you the
ip4:entry to add to your SPF record. - Sender domains are checked against DNS blocklists every six hours.
Installing takes a few commands; the quick start covers Docker Compose, the first mailbox and HTTPS.
🎯 Expert tips
Send newsletters from news.example.com and invoices from billing.example.com. Each gets its own reputation and can get its own DMARC policy, and a problem with one does not drag down the other.
Printers, scanners, invoicing tools and old servers often send a few messages a month. Find them in the reports while you are still at p=none or quarantine.
Adding a new service that sends as your domain is the most common way a working setup breaks. Add its SPF and DKIM before its first send.
Remove pct=100, ri=86400 and rf=afrf from DMARC records and ptr from SPF records. They do nothing useful today.
Frequently asked questions
Do I need DMARC if I send fewer than 5,000 emails a day?
Gmail and Yahoo require only SPF or DKIM from smaller senders, but without a DMARC record anyone can put your domain in the From line and receivers have no policy to apply. A p=none record with a rua address costs nothing and shows you who sends as your domain.
Is p=none enough?
It meets the minimum that Gmail, Yahoo and Outlook.com ask of bulk senders, but it protects nothing: mail that fails DMARC is delivered as usual. Use it to collect reports, then move to p=quarantine and p=reject.
Should I remove pct=100 from my DMARC record?
RFC 9989 removed the pct tag in May 2026, and receivers must ignore tags they do not know, so pct=100 is harmless. Remove it the next time you edit the record, and replace pct=0 with t=y.
What does ri=86400 mean in a DMARC record?
It asked receivers to send aggregate reports every 86,400 seconds, one day. RFC 9989 removed the tag; receivers choose the interval themselves and usually report once per UTC day.
Does DMARC protect my subdomains?
Yes. The p policy covers the domain, sp covers its subdomains and np covers subdomains that do not exist in DNS. A subdomain with its own _dmarc record uses that record instead.
Can a domain have two SPF records?
No. Two TXT records starting with v=spf1 make SPF return a permanent error, so every message fails SPF. Merge all senders into one record and keep it under 10 DNS lookups.
Sources
- Google: Email sender guidelines
- Google: Email sender guidelines FAQ
- Yahoo: Sender best practices and requirements
- Microsoft: Outlook's new requirements for high-volume senders
- RFC 9989: Domain-based Message Authentication, Reporting, and Conformance (DMARC)
- RFC 9990: DMARC Aggregate Reporting
- RFC 7208: Sender Policy Framework (SPF)
- Amazon SES: Using a custom MAIL FROM domain
Run your newsletter on your own server
NetSendo sends through the provider you choose, and Deliverability Shield keeps an eye on the SPF, DKIM and DMARC records of each sending domain.

