Skip to content

SPF, DKIM and DMARC: What Is the Difference?

SPF checks the sending server, DKIM checks a signature, and DMARC ties both to the From address and sets a policy. See how the three fit together and what to set up first.

9 min readUpdated Nov 22, 2026By XPASS Editorial Team

SPF, DKIM and DMARC: What Is the Difference?

Anyone who sets up email for a domain soon meets three acronyms: SPF, DKIM and DMARC. They are often mentioned together, which makes them sound like three names for the same thing. They are not. Each answers a different question about a message, and the real protection comes from how they work together.

This guide compares the three in plain language. You will see what each one checks, why none of them is enough alone, how they combine, and what order is sensible for setting them up. If you want a deeper explanation of any single one, the related guides on SPF and DKIM go step by step.

The problem all three try to solve

Email's original design lets the sender type any address into the From line. That made forgery easy: someone can send a message that appears to come from your domain without ever touching your systems. Receiving servers needed a way to ask whether a message really came from where it claimed.

The three standards form a chain of answers.

  • SPF answers: "Was this message sent by a server the domain approved?"
  • DKIM answers: "Was this message signed by the domain, and has it stayed unchanged?"
  • DMARC answers: "Does the domain that passed those checks match the From address the reader sees, and what should I do if not?"

SPF in brief

SPF, or Sender Policy Framework, is defined in RFC 7208. The domain owner publishes a TXT record listing the servers and services allowed to send mail. The receiving server compares the connecting IP address with that list.

What it checks: the sending server, against the domain used in the SMTP envelope (the Return-Path or MAIL FROM) or in the HELO greeting.

Strengths: simple to publish, one record per domain, no changes needed in the message itself.

Weaknesses: it does not look at the visible From address, it can break when mail is forwarded, and it has a limit of ten DNS lookups.

DKIM in brief

DKIM, or DomainKeys Identified Mail, is defined in RFC 6376. The sending system signs selected headers and the body with a private key and adds a DKIM-Signature header. The receiver finds the public key in DNS, at a name made from a selector and the signing domain, and verifies the signature.

What it checks: that the signed parts of the message were not altered and that the signing domain, the d= value, took responsibility.

Strengths: the signature travels with the message, so it often survives forwarding, and it ties the message to a domain rather than to an IP address.

Weaknesses: it requires a key pair and DNS publication for each sending service, it can be broken by systems that modify messages, and the signing domain does not have to match the visible From address.

DMARC in brief

DMARC, or Domain-based Message Authentication, Reporting, and Conformance, is defined in RFC 7489. The domain owner publishes a TXT record at _dmarc with a policy and a reporting address.

What it checks: it takes the results of SPF and DKIM and requires that at least one of them passes and aligns with the domain in the visible From header. If neither does, the receiver is asked to apply the policy: none, quarantine or reject.

Strengths: it closes the gap between what SPF and DKIM prove and what the reader sees, and its reports show who sends mail in your name.

Weaknesses: it depends on SPF and DKIM being correct first, and its policy is a request that receivers may treat with discretion. Read more in our guide on what DMARC is and why businesses need it and, for the reporting side, in the guide to a DMARC reporting service and who it suits.

Side-by-side comparison

Feature SPF DKIM DMARC
Question it answers Is this server allowed to send? Is this message signed and unchanged? Does a passing result match the visible From, and what to do if not?
What is checked Sending IP address Cryptographic signature Results of SPF and DKIM plus alignment
Domain it concerns Envelope sender or HELO The d= signing domain The visible From domain
DNS record TXT at the domain TXT or CNAME at selector._domainkey TXT at _dmarc
Survives forwarding Often not Usually, unless the message is altered Depends on SPF or DKIM passing
Gives reports No No Yes, aggregate reports
Sets a policy Only a result qualifier No Yes: none, quarantine, reject

How they work together

Imagine a message arriving at a receiving server.

  1. The server checks SPF for the envelope domain. Suppose it passes, but the envelope domain is a bounce domain belonging to a mail service, not your own domain.
  2. The server checks DKIM. The message carries a signature with d=example.com, and it verifies.
  3. The server looks at DMARC for example.com, the visible From domain. SPF passed but did not align, because the envelope domain differs. DKIM passed and aligned. One aligned pass is enough, so DMARC passes.

Now imagine a forged message. It claims to be from example.com in the From line, and was sent by a criminal's server. SPF for the criminal's own domain might pass, but it does not align with example.com. There is no valid DKIM signature for example.com. DMARC fails, and if you have published an enforcing policy, a receiver that honors it will quarantine or reject the message.

This is why the three belong together. SPF and DKIM supply evidence. DMARC decides whether that evidence is relevant to the address the reader sees.

What to set up first

A sensible order for a business domain is:

  1. List your senders. Include mailbox, website forms, marketing, invoicing and helpdesk tools.
  2. Publish SPF as a single record that includes each legitimate sender, staying within the ten-lookup limit.
  3. Enable DKIM in every sending service, ideally with signatures that use your own domain.
  4. Publish DMARC with p=none and a report address. Nothing is blocked yet, but you start to see who sends mail as you.
  5. Review reports for several weeks and fix legitimate senders that fail.
  6. Tighten the policy step by step, to quarantine and then reject, while watching for problems.

A plain example

A small training company, example.com, sends staff mail from a hosted mailbox, course reminders from a learning platform, and receipts from a payment tool.

After listing senders, the manager publishes SPF with includes for the mailbox provider and the payment tool. The learning platform sends from its own bounce domain, so SPF would not align for it. She enables DKIM there with the company's own domain. She publishes DMARC with p=none and a report address.

The first reports show the three expected sources passing, plus an unknown source that fails everything. After a month she moves to quarantine, then to reject. She never needed to chase the unknown sender. She made her own mail pass and told receivers what to do with the rest.

Limits and what to watch for

  • None of them reads the content. A message can pass all three checks and still be a scam if it was sent from a real account that an attacker has taken over.
  • Lookalike domains are not covered. The checks apply to the domain you protect, not to similar-looking names someone else registers.
  • Forwarding and lists need care. Forwarding can break SPF, and lists that edit messages can break DKIM, which is another reason to use both.
  • Third-party senders need setup. Each service that sends as you must be added to SPF or signed with your DKIM key, ideally both.
  • Policies are requests. Receivers may treat failures differently, and not every receiver acts on DMARC the same way.
  • Passing authentication is not the same as being wanted. Content, engagement and complaints still affect where mail lands.
  • Protection of your inbox is separate. These checks are mainly about others forging your domain. Filtering what you receive is another job, covered in other guides in this series.

Common mistakes

  • Publishing SPF twice instead of merging into one record.
  • Going over the ten-lookup limit by adding too many includes.
  • Enabling DKIM but leaving the service signing with the provider's own domain.
  • Jumping straight to p=reject without reading reports.
  • Forgetting rarely used senders, such as billing systems.
  • Setting up the records once and never reviewing them when tools change.

Common misconceptions

"SPF alone stops spoofing." It does not. SPF checks the envelope domain, which a forger controls. Without DMARC alignment, a criminal can pass SPF with their own domain while showing yours in the From line.

"DKIM encrypts my email." It does not. DKIM only signs. Anyone who handles the message can still read it. Protecting content in transit is the job of transport encryption between servers, which is a separate topic.

"DMARC blocks spam sent to me." It does not. DMARC is a way for a domain owner to protect their own name. Your inbox needs separate filtering.

"If I pass all three, my mail always reaches the inbox." Authentication is a baseline. Reputation, content and recipient behavior also influence placement, and no setup can promise a result.

"Once it works, I can forget it." Providers change addresses, staff add tools, and keys age. A quick review whenever you add or remove a mail service keeps the records honest.

How to check your setup

You can verify all three with a single test message. Send an email from each of your sending systems to a mailbox at a different provider, open the original message source, and find the Authentication-Results header. Look for three lines: spf=pass, dkim=pass and dmarc=pass. Next to each, note the domain it refers to. For SPF, the domain is the envelope sender. For DKIM, it is the header.d value. For DMARC, it is the From domain, and the result tells you that at least one of the other two passed and aligned.

If DMARC fails while SPF and DKIM both pass, the cause is almost always alignment. The passing domains differ from the visible From domain, which typically means a third-party service is using its own domain instead of yours. The fix is to configure that service for custom domain authentication.

If SPF reports a permanent error, count your lookups. If DKIM reports that no key was found, check the selector name and whether the record has been published exactly as given. Fixing problems one layer at a time is far quicker than guessing.

Summary

SPF checks which server sent a message, DKIM checks that the message is signed and unaltered, and DMARC ties both to the address people see and publishes your policy and reporting address. Each has a blind spot that another covers, so a complete setup uses all three. Start with a list of senders, publish SPF, enable DKIM everywhere, and add DMARC at p=none before tightening step by step. Expect limits around lookalike domains, hijacked accounts and receiver discretion. To see how a hosted business email or email security service can help you manage these checks, take a look at the product pages.

Frequently asked questions

What is the main difference between SPF, DKIM and DMARC?

SPF checks whether the sending server is authorized for the envelope domain. DKIM checks a cryptographic signature added to the message. DMARC requires that SPF or DKIM passes in alignment with the visible From domain and tells receivers what to do when it does not.

Do I need all three?

Yes, ideally. Each covers a gap the others leave. SPF and DKIM provide the evidence, and DMARC turns that evidence into a policy tied to the address people actually see.

Which one should I set up first?

Start with SPF and DKIM for every sender, then publish DMARC with p=none to collect reports, and tighten the policy once legitimate mail passes consistently.

Can DMARC pass if only one of SPF or DKIM passes?

Yes. DMARC needs at least one of them to pass and align with the From domain. Having both pass is more resilient, because forwarding can break SPF and mailing lists can break DKIM.

About the author

Bob Kanokphon Thongdee, founder of XPASS VPN

Bob Kanokphon Thongdee

  • Founder of XPASS VPN
  • Co-founder of eSIMonline.asia
  • More than 7 years in online marketing
  • Founder of Cojourney Visa and Cojourney Travel

Protect your email and stop spoofing

Spam filtering and DMARC monitoring for your domain.

See email security

Keep reading

Business Email Guides

What Is DKIM and How Does It Help Verify Email?

DKIM adds a digital signature to every outgoing message so receivers can check it was not altered and that your domain approved it. Learn how it works and how to set it up.

10 min read

Business Email Guides

What Is EasyDMARC and Who Is It For?

EasyDMARC is a hosted DMARC monitoring tool. See what it does, who it suits, how setup works and where its limits are before you decide.

10 min read

Business Email Guides

What Is SPF and How Do You Set It Up?

SPF is a DNS record that lists which servers may send email for your domain. Learn how to write it, test it and avoid the mistakes that break it.

10 min read