NetSendo
Guides & Tips

SPF, DKIM and DMARC Explained: Setup Guide for 2026

NetSendo Team14 min read
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.

TL;DR: Publish one SPF record that names every service sending for your domain, sign every message with DKIM using your own domain (2048-bit keys where the provider allows it), and publish a DMARC record that starts at 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.

RecordPublished at (DNS name)What it checksPasses when
SPFTXT at the envelope sender domain, e.g. example.com or bounce.example.comThe IP address of the server that connectedThe IP matches a mechanism in the record
DKIMTXT (or a CNAME to the provider's key) at selector._domainkey.example.comA signature over chosen headers and the bodyThe signature verifies with the published public key
DMARCTXT at _dmarc.example.comWhether SPF or DKIM passed for a domain aligned with the From headerAt least one aligned pass

As of November 2026, DMARC per RFC 9989.

Alignment

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: and ip6: 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.
  • a and mx authorise the addresses of the domain's A or MX records.
  • all at the end decides what happens to everyone else: -all fail, ~all soft fail, ?all neutral. +all lets any server on the internet pass, so never use it.

Four rules from RFC 7208 cause most broken SPF records:

  1. One record per name. Two TXT records that both start with v=spf1 produce a permanent error, and SPF then fails for every message. Merge them into one.
  2. At most 10 DNS lookups. Every include, a, mx, ptr, exists and redirect costs 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.
  3. Do not use ptr. The RFC says it should not be used: it is slow and unreliable.
  4. 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 ~all even after DMARC is enforcing. A hard -all can 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.net gives you a DKIM pass that does not align. Turn on the provider's custom-domain DKIM so that d= 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"
TagValuesIf absentWhat it does
vDMARC1Record ignoredRequired, and must be the first tag
pnone, quarantine, rejectTreated as nonePolicy for mail that fails DMARC
spsame as pp appliesPolicy for subdomains
npsame as psp, then pPolicy for subdomains that do not exist in DNS
ty, nnTesting: y asks receivers to apply one step less
ruacomma-separated mailto: URIsNo aggregate reportsWhere receivers send aggregate reports
rufcomma-separated mailto: URIsNo failure reportsWhere receivers send per-message failure reports
adkimr, sr (relaxed)DKIM alignment mode
aspfr, sr (relaxed)SPF alignment mode
fo0, 1, d, s0When failure reports are made; ignored without ruf
psdy, n, uuFor 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 know t and applies your p in full. Treat t=y as 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, ri and rf.
  • Added tags: t (testing), np (non-existent subdomains, carried over from RFC 9091) and psd (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=reject once 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.

ProviderWho counts as a bulk senderAuthentication for bulk sendersOther requirementsEnforcement
Gmail (personal accounts)Close to 5,000 or more messages in 24 hours, counted per primary domain; the status does not expireSPF, DKIM and DMARC (p=none or stricter); From aligned with SPF or DKIMPTR records, TLS, one-click unsubscribe, spam rate below 0.30% (target below 0.10%)Since February 2024; from November 2025 temporary and permanent rejections
YahooVolume not publishedSPF and DKIM; DMARC at least p=none that passes; relaxed alignment acceptedOne-click unsubscribe, unsubscribes honoured within 2 days, spam rate below 0.3%Since February 2024
Outlook.com, Hotmail, LiveDomains sending more than 5,000 messages a daySPF 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.

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

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

  3. Turn on DKIM everywhere

    Enable custom-domain signing in each service and publish its selector record (TXT or CNAME).

  4. Publish DMARC with p=none

    v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com collects reports without changing delivery. Leave it for two to four weeks so that monthly mailings also show up.

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

  6. Enforce

    Move to p=quarantine, watch the reports again, then to p=reject. Add sp and np if your subdomains do not send mail of their own.

  7. Lock domains that never send

    Parked and redirect-only domains get v=spf1 -all and v=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 seeCauseFix
SPF pass, DMARC failThe envelope sender is the provider's domainCustom MAIL FROM subdomain, or DKIM with your domain
DKIM pass for d=provider.netThe provider signs with its own domainTurn on custom-domain DKIM
SPF permerrorTwo SPF records, or more than 10 lookupsMerge the records, remove unused includes
Forwarded mail fails SPFThe forwarding server's IP is not in your recordDKIM normally survives plain forwarding; keep every stream DKIM-signed
Mailing-list posts fail DKIMThe list changes the subject or adds a footerLists 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: Send rua to 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=none and offers quarantine and then reject as the next steps, with relaxed alignment, no ruf, and your existing rua address 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

1
Give each mail stream its own subdomain

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.

2
Look for the quiet senders before you reject

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.

3
Re-check after every new tool

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.

4
Clean up records copied from old guides

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

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.

#dmarc#spf#dkim#email authentication#email deliverability
Share