Blog · SEO

SPF, DKIM and DMARC: How to Stop Email Spoofing Step by Step

Without SPF, DKIM and DMARC, anyone can send email that appears to come from your domain, and your own mail is more likely to land in spam. How the three records work together, what Gmail and Yahoo require, how our free SPF and DMARC checker reads your domain, and how to fix every result.

Searvia · 10/24/2026 · 12 min read

In short: SPF lists the servers allowed to send mail for your domain, DKIM signs each message, and DMARC checks that one of them passes for the domain in the visible From address, then tells receivers what to do with mail that fails. Since February 2024, Gmail and Yahoo require SPF or DKIM from every sender and SPF, DKIM and DMARC from bulk senders, and Gmail has been enforcing harder since November 2025. Publish one SPF record, turn on DKIM at every service that sends for you, start DMARC at p=none with reports, and move to p=quarantine or p=reject once your legitimate mail passes.

Email was designed without any proof of who sent a message. Anyone can put [email protected] in the From line, and without authentication records, the receiving server has no way to tell that it's fake. That's how invoice fraud and phishing in your name work, and it's also why your real mail can look suspicious to Gmail.

SPF, DKIM and DMARC fix this with three DNS records. This guide explains how they fit together, what the big mailbox providers require, how our free SPF and DMARC checker reads your domain, and how to get from no records to an enforced policy without breaking your own mail.

How SPF, DKIM and DMARC work together

SPFDKIMDMARC
What it provesThe sending server is allowed to send for a domainThe message was signed by a domain and not changedSPF or DKIM passed for the domain people see in From
Which domain it checksThe envelope sender (MAIL FROM) or HELO, not the visible FromThe d= domain in the signatureThe visible From domain
Where it livesTXT record on the domainTXT record at selector._domainkey.domainTXT record at _dmarc.domain
What happens on failureReceiver decidesReceiver decidesYour policy: none, quarantine or reject
ReportsNoNoYes, aggregate reports to your rua address

The weak spot of SPF and DKIM alone is the "which domain" row. RFC 7208 says SPF checks the MAIL FROM and HELO identities, which the recipient never sees. A spoofer can pass SPF for their own domain while showing yours in the From line. DMARC closes that gap with alignment: a message passes DMARC only if SPF or DKIM passes for a domain that matches the From domain (relaxed alignment allows subdomains of the same organization).

SPF in one record

example.com.  TXT  "v=spf1 include:_spf.google.com include:sendgrid.net -all"

Each include authorizes a provider's servers; -all at the end says everything else fails. RFC 7208 defines the qualifiers: - is fail, ~ is softfail ("probably not authorized"), ? is neutral and + is pass. +all authorizes the entire internet and defeats the purpose.

DKIM in one record

Your mail provider signs outgoing messages with a private key and gives you a public key to publish under a selector, for example google._domainkey.example.com. Each sending service uses its own selector, so you can have several DKIM keys at once (RFC 6376).

DMARC in one record

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

p is the policy for the domain, sp for subdomains, and rua receives daily aggregate reports from receivers listing which servers sent mail as your domain and whether it passed.

The DMARC standard was updated in 2026

In May 2026 the IETF published RFC 9989, which obsoletes the original DMARC specification, RFC 7489, and moves DMARC to the Standards Track. Existing records keep working; the version tag is still v=DMARC1. The changes worth knowing:

Receivers will move to the new rules at different speeds, and Google's own setup guide still recommends pct during rollout. Using pct doesn't break anything, but don't rely on it as a precise percentage.

What Gmail and Yahoo require

Both providers started enforcing sender requirements in February 2024.

RequirementAll sendersBulk senders (Gmail: 5,000+ messages a day to Gmail accounts)
AuthenticationSPF or DKIMSPF and DKIM
DMARCNot requiredRequired, policy can be p=none
AlignmentFrom domain aligned with SPF or DKIM
Spam rateBelow 0.3%Below 0.3%
UnsubscribeOne-click unsubscribe for marketing mail; Yahoo: honored within 2 days
OtherValid forward and reverse DNS, RFC 5322 format; Gmail: TLSSame

Sources: Google's sender guidelines and Yahoo's sender best practices. Google warns that unauthenticated messages "might be marked as spam or rejected with a 5.7.26 error," and its FAQ says: "Starting November 2025, Gmail is ramping up its enforcement on non-compliant traffic," with temporary and permanent rejections. The same FAQ recommends aligning DMARC with both SPF and DKIM and says that alignment will likely become a requirement later.

Even if you send far fewer than 5,000 messages a day, these records decide whether your invoices, password resets and replies reach the inbox, and whether someone else can send convincing mail in your name.

How the Searvia SPF and DMARC checker works

The free SPF and DMARC checker is part of our website SEO checker and shows the email authentication check first. Enter a domain (a leading www. is removed) and it:

ResultWhenMessage
PassOne valid SPF record and DMARC policy is quarantine or reject"SPF and an enforced DMARC policy are set." (with a note if DMARC has no rua address)
WarningMore than one SPF record"The domain has N SPF records; with more than one, SPF fails."
WarningMore than 10 SPF lookups"SPF needs at least N DNS lookups; above 10, SPF fails."
WarningDMARC is p=none"DMARC is set to "none", so spoofed email still reaches inboxes."
WarningSPF present, no DMARC"DMARC is missing."
WarningDMARC present, no SPF"SPF is missing."
FailNeither record"Neither SPF nor DMARC is set, so anyone can send email in your name."

In the overall audit this check has medium priority. Note how strict it is about DMARC: p=none meets Gmail's minimum but still shows a warning, because it doesn't stop spoofing.

What the free check does not cover:

How to read your result

How to fix it, step by step

Step 1: List everything that sends mail as your domain

Your mailbox provider (Google Workspace, Microsoft 365), newsletter tool, CRM, help desk, invoicing software, e-commerce platform, website contact form and any server that sends notifications. Missing one here is the main reason DMARC enforcement goes wrong later.

Step 2: Publish one SPF record

If a provider sends with its own envelope domain (common for newsletter tools), it doesn't need to be in your SPF at all; it needs DKIM with your domain for DMARC to pass.

Step 3: Turn on DKIM for every sender

In each service, find the domain authentication or DKIM setting, publish the record it gives you (a TXT or CNAME under a selector) and activate signing. Google recommends allowing 48 hours after setting up SPF and DKIM before adding DMARC. Then send a test message to a Gmail address and check "Show original": you want SPF: PASS, DKIM: PASS and DMARC: PASS.

Step 4: Publish DMARC at p=none with reports

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

Google recommends starting with p=none and always including rua. Aggregate reports are XML files; a DMARC report service or a parser makes them readable. If the report address is on another domain, that domain has to authorize it with a DNS record.

Step 5: Read the reports and fix failures

For two to four weeks, look for legitimate services that fail SPF or DKIM alignment. Each one needs DKIM signing with your domain or an SPF include. Forwarded mail and mailing lists can fail for legitimate reasons; RFC 9989 suggests that domains whose users post to mailing lists spend at least a month at p=none and a similar period at p=quarantine before p=reject.

Step 6: Move to quarantine, then reject

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

Change one step at a time and keep watching reports. When you reach p=quarantine, our checker passes. p=reject is the goal: receivers refuse mail that fails.

Step 7: Lock down domains that don't send mail

Parked domains and redirect-only domains are attractive to spoofers because nobody watches them. The UK government's guidance recommends:

example.net.               TXT  "v=spf1 -all"
_dmarc.example.net.        TXT  "v=DMARC1; p=reject; sp=reject; adkim=s; aspf=s"
*._domainkey.example.net.  TXT  "v=DKIM1; p="
example.net.               MX   0 .

Check the records yourself

The checker reads SPF and DMARC; you can see all three records with standard DNS tools. On macOS or Linux:

dig +short TXT example.com
dig +short TXT _dmarc.example.com
dig +short TXT google._domainkey.example.com

On Windows, nslookup -type=TXT _dmarc.example.com does the same. For DKIM you need the selector, which your provider shows in its DKIM settings and which appears as s= in the DKIM-Signature header of any message you sent; google is the default for Google Workspace. Some providers publish the key as a CNAME that points to their own DNS, which is fine.

The most reliable end-to-end test is a real message. Send one from each service to a Gmail address and open "Show original": it lists the SPF, DKIM and DMARC result and the domain each one passed for. A DKIM pass for the provider's domain instead of yours means DMARC alignment still fails, so look for your own domain in the result.

Common mistakes

MistakeEffectFix
Two SPF records (often one per provider)permerror: SPF fails everywhereMerge into one record
More than 10 lookupspermerrorRemove old includes; avoid ptr and mx where not needed
+all or ?allSPF authorizes everyone, or says nothingEnd with -all or ~all
DMARC on the root instead of _dmarcNo DMARC foundPublish at _dmarc.example.com
p=none foreverReports, but no protectionPlan the move to quarantine and reject
A sender with no DKIMFails DMARC at enforcementTurn on DKIM with your domain in that service
Subdomains forgottenSpoofing via mail.example.comSet sp= and check subdomains that send

Worked example (hypothetical)

The following is a hypothetical example, not real data. Pinecrest Dental, an invented clinic, hears from patients that they received a fake payment request "from" the clinic. The SPF and DMARC checker shows:

Step 1 finds three senders: Google Workspace, the booking system that emails reminders and an email newsletter tool. The booking system needs an SPF include; the newsletter tool uses its own envelope domain, so it gets DKIM with the clinic's domain instead. The clinic publishes DMARC at p=none with a report address. Two weeks of reports show the booking system passing SPF and the newsletter passing DKIM, plus a few hundred messages from unknown servers in other countries failing both: the spoofing. The clinic moves to p=quarantine, where the checker passes, and a month later to p=reject. Fake messages in its name are now refused by receivers that apply DMARC.

A checklist you can finish this week

How Searvia watches your email authentication

The free SPF and DMARC checker reads your records in seconds, with no sign-up, as part of a 38-check audit that also covers your website's search appearance, speed and security.

A free Searvia account adds a weekly security scan that goes further on email: it flags an SPF record that is missing or too open (+all, ?all or no all at all), a DMARC policy that is missing or still p=none, and a missing CAA record, with the DNS lookup behind each finding and a record you can copy. The scan repeats every Thursday, so a DNS change that breaks your records shows up within a week. For the website side of security, see our security headers guide.

Frequently Asked Questions

What is the difference between SPF, DKIM and DMARC?
SPF lists the servers allowed to send email for your domain. DKIM adds a cryptographic signature to each message that receivers check against a public key in your DNS. DMARC ties them to the address people see in the From line: a message passes DMARC when SPF or DKIM passes for a domain that aligns with the From domain, and your DMARC policy tells receivers what to do with messages that fail and where to send reports.
Do I need DMARC if I have SPF and DKIM?
Yes. SPF and DKIM on their own don't protect the From address people see, and they don't tell receivers what to do when checks fail. DMARC adds that link and the policy. Gmail and Yahoo require a DMARC record (at least p=none) from bulk senders, alongside SPF and DKIM; Gmail counts anyone sending 5,000 or more messages a day to Gmail accounts as a bulk sender.
What DMARC policy should I use?
Start with p=none and a rua address to collect reports, which shows you every service sending as your domain without affecting delivery. Once all legitimate mail passes SPF or DKIM with alignment, move to p=quarantine and then p=reject. Only quarantine or reject actually stops spoofed email; p=none only monitors.
Why does my SPF record fail with a permerror?
The two most common causes are having more than one SPF record on the domain, which RFC 7208 says produces a permerror, and exceeding the limit of 10 DNS lookups caused by include, a, mx, ptr, exists and redirect terms. Merge everything into one v=spf1 record and remove includes for services you no longer use.
How do I protect a domain that doesn't send email?
Publish an SPF record of v=spf1 -all, which says no server may send for the domain, and a DMARC record with p=reject. The UK government's guidance for such domains also adds sp=reject for subdomains, an empty DKIM record and a null MX record. This stops anyone from using a parked or redirect-only domain for phishing.

Sources

  1. Email sender guidelines – Google Workspace Admin Help
  2. Email sender guidelines FAQ – Google Workspace Admin Help
  3. Set up DMARC – Google Workspace Admin Help
  4. Sender Best Practices – Yahoo Sender Hub
  5. RFC 7208: Sender Policy Framework (SPF) – IETF
  6. RFC 6376: DomainKeys Identified Mail (DKIM) Signatures – IETF
  7. RFC 9989: Domain-Based Message Authentication, Reporting, and Conformance (DMARC) – IETF
  8. RFC 7489: Domain-based Message Authentication, Reporting, and Conformance (DMARC) – IETF
  9. Protect domains that do not send email – GOV.UK

Keep Reading