Home / Knowledge Base / Tools and integrations / SPF, DKIM and DMARC: Email Authentication Explained

SPF, DKIM and DMARC: Email Authentication Explained

Tools and integrations 7 min read Updated 13.10.2026
What SPF, DKIM and DMARC each do, how alignment ties them together, what Gmail and Yahoo require from senders, a setup checklist and the mistakes that break mail.

Anyone can put your domain in the From line of an email. SMTP, the protocol that carries mail, was designed in an era of trust and never checks it. Email authentication is the set of DNS records that lets receiving servers check it for you: SPF says which servers may send for your domain, DKIM adds a cryptographic signature to every message, and DMARC ties both to the address the recipient actually sees and tells receivers what to do when the check fails.

Without these records your legitimate mail is more likely to land in spam, and scammers can impersonate your domain with little effort. This guide explains what each record does, how they work together and what to check first.

SPF: who is allowed to send

SPF (Sender Policy Framework) is a single TXT record on your domain that lists the servers allowed to send mail on its behalf. A typical record looks like this:

example.com.  TXT  "v=spf1 ip4:203.0.113.10 include:_spf.google.com ~all"
  • v=spf1 — marks the record as SPF. It must come first.
  • ip4: / ip6: — individual addresses or ranges.
  • include: — "also trust whoever this other domain lists". This is how you authorize Google Workspace, Microsoft 365 or a newsletter service.
  • a and mx — the servers your A or MX records point to.
  • ~all or -all — what to do with everyone else: soft fail (accept but treat as suspicious) or fail.

One detail is easy to miss: SPF checks the envelope sender (the Return-Path address used during delivery), not the From address shown in the mail client. Newsletter platforms often use their own Return-Path domain, so SPF can pass while proving nothing about your From domain. That gap is exactly what DMARC closes.

Check what your domain publishes with the SPF checker: it shows the parsed mechanisms, the final qualifier and how many DNS lookups the record needs.

DKIM: a signature on every message

DKIM (DomainKeys Identified Mail) works like a seal. 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 verifies that nothing was changed in transit. Two tags in the signature matter most:

  • d= — the signing domain;
  • s= — the selector, the name under which the public key is published: selector._domainkey.example.com.

Because the key is found by selector, a domain can have several DKIM keys at once — one for your mailbox provider, one for your newsletter tool, one for your CRM. Selectors, key length and rotation are covered in detail in What is DKIM. To see whether a key exists and how long it is, use the DKIM checker.

DMARC: alignment and policy

DMARC (Domain-based Message Authentication, Reporting and Conformance) is a TXT record at _dmarc.example.com:

_dmarc.example.com.  TXT  "v=DMARC1; p=none; rua=mailto:[email protected]"

It does three things:

  1. Requires alignment. A message passes DMARC only if SPF or DKIM passes and the domain it passed for matches the domain in the visible From address. For SPF that is the Return-Path domain, for DKIM the d= domain. By default the match is "relaxed": mail.example.com aligns with example.com because they share the organizational domain.
  2. Sets a policy for messages that fail: none (only report), quarantine (spam folder) or reject (refuse delivery).
  3. Turns on reports. Receivers send daily aggregate reports to the rua address, so you can see every server that sends mail as your domain — including ones you forgot about.

Every tag, the rollout from p=none to p=reject and how to read the reports are explained in DMARC record: how to set up DMARC step by step.

How the three work together

SPFDKIMDMARC
Where it livesTXT on the domainTXT (or CNAME) at selector._domainkeyTXT at _dmarc
What it checksThe sending IP against the listThe signature against the public keyThat SPF or DKIM passed for the From domain
Survives forwardingUsually notUsually yes, if the message is not modifiedPasses if at least one aligned check survives
Can block spoofing aloneNoNoYes, with quarantine or reject

The practical takeaway: DKIM is the more robust half because it survives forwarding. Aim for every legitimate stream of mail to pass aligned DKIM, and treat SPF as a second line.

What Gmail and Yahoo require from senders

Since February 2024 Google and Yahoo have enforced published sender requirements, and other large mailbox providers have moved in the same direction. In short:

  • Everyone sending to personal Gmail or Yahoo addresses needs SPF or DKIM, valid forward and reverse DNS for sending IPs, TLS, and a low spam complaint rate.
  • Bulk senders (Google names a threshold of around 5,000 messages a day to its users) need SPF and DKIM, a DMARC record with at least p=none, a From domain aligned with SPF or DKIM, and one-click unsubscribe for marketing mail.
Check current guidance
Thresholds and details change. Before a big campaign, read the current sender guidelines of Google, Yahoo and Microsoft rather than relying on any summary, including this one.

Setup checklist

  1. List every service that sends as your domain: mailbox provider, website contact form, newsletter tool, CRM, helpdesk, billing system. Forgotten senders are the main reason DMARC rollouts break mail.
  2. Publish one SPF record that covers the services which use your domain in the Return-Path. Keep it under 10 DNS lookups.
  3. Turn on DKIM in each service with your own domain, not the provider's default. Each service gives you a TXT or CNAME record to publish.
  4. Publish DMARC with p=none and a rua address you actually read or a report-processing service.
  5. Read the reports for 2–4 weeks and fix every legitimate source that fails alignment.
  6. Tighten the policy step by step: quarantine, then reject.
  7. Check the basics around it: the MX lookup confirms where your mail is received, and the IP blacklist check shows whether your sending IP is listed. For the rest of the DNS picture see checking domain DNS records.

Common mistakes

Two SPF records

Adding a new service often ends with a second v=spf1 record next to the old one. The SPF standard treats this as a permanent error, and many receivers then ignore SPF entirely. There must be exactly one SPF record; merge the mechanisms into it.

More than 10 DNS lookups

Each include, a, mx, ptr, exists and redirect costs a lookup, and includes inside includes count too. Above 10 the result is a permanent error. Remove services you no longer use, replace a/mx with explicit IPs where they are stable, and avoid ptr.

Third-party senders without DKIM

Google Workspace, Microsoft 365, Mailchimp and similar services can all sign with your domain, but usually only after you publish their DKIM records and enable signing. Until then they sign with their own domain or not at all, and the mail fails DMARC alignment.

p=reject on day one

Jumping straight to reject without reading reports blocks every sender you forgot: the invoice system, the website form, a partner sending on your behalf. Start with p=none, collect data, then tighten.

Forgetting domains that never send mail

Parked and secondary domains are popular for spoofing exactly because nobody watches them. For a domain that sends nothing, publish v=spf1 -all and v=DMARC1; p=reject.

A real example

Our own domain publishes v=DMARC1; p=none; rua=mailto:[email protected] and signs mail with DKIM selector mail using a 2048-bit key (checked in October 2026). That is a normal monitoring stage: reports are collected, and the policy is tightened once every source is confirmed. Run the DMARC checker on your own domain to see where you stand.

FAQ

Do I need SPF, DKIM and DMARC, or is one enough?
All three. SPF and DKIM authenticate the sender, but neither checks the From address the recipient sees. DMARC links them to that address and tells receivers what to do with failures. Bulk senders to Gmail and Yahoo are required to have all three.
What is DMARC alignment?
A message passes DMARC only if SPF or DKIM passes for a domain that matches the From domain. For SPF that is the Return-Path domain, for DKIM the d= domain. In relaxed mode subdomains of the same organizational domain count as a match.
Can a domain have two SPF records?
No. Two v=spf1 records cause a permanent error and many receivers then ignore SPF. Merge all mechanisms into one record.
What is the SPF 10 DNS lookup limit?
Evaluating an SPF record may trigger at most 10 DNS lookups through include, a, mx, ptr, exists and redirect, including nested includes. Above that the result is a permanent error.
Should I start DMARC with p=reject?
No. Start with p=none and a rua address, read the reports for a few weeks, fix every legitimate sender, then move to quarantine and finally reject.
Was this article helpful?
Try it on your project Everything described in the article is available in the dashboard — the registration bonus is already in your balance.
Open dashboard