DMARC, SPF and DKIM Explained: Stop Email Spoofing on Your Domain
SPF, DKIM, and DMARC are three DNS records that stop email spoofing — but only together. Learn what each one does and how to set them up step by step.
By Galactic News Editorial · Published 2026-11-25T16:38:23+00:00 · Updated 2026-11-25T16:38:23+00:00
DMARC, SPF and DKIM Explained: Stop Email Spoofing on Your Domain
Anyone can send an email that claims to come from your domain. The original email system never checked who the sender really was. That gap lets scammers impersonate your business, trick your customers, and phish your staff.
SPF, DKIM, and DMARC close that gap. They are three DNS records that work together. SPF lists the servers allowed to send for your domain. DKIM adds a cryptographic signature to each message. DMARC ties both to the address people see and tells receivers what to do with mail that fails. Set up all three, and spoofed mail from your domain starts getting blocked.
DMARC, SPF and DKIM Explained: What Each One Does
Think of the three standards as three checks at a door. Each answers a different question.
SPF (Sender Policy Framework) answers: is this server allowed to send mail for this domain? You publish a list of authorized sending servers in a DNS TXT record. The receiving server checks the sending server's address against that list.
DKIM (DomainKeys Identified Mail) answers: was this message altered in transit, and did it come from someone holding the domain's private key? Your mail server signs outgoing messages with a private key. Receivers verify the signature with a public key published in your DNS. The signature also proves the message content was not changed on the way.
DMARC (Domain-based Message Authentication, Reporting and Conformance) answers: does the message match the domain the reader actually sees, and what should happen if it fails? DMARC checks whether SPF or DKIM passes and aligns with the visible From address. It also gives you reports about who is sending mail as your domain.
Security guidance from CISA states plainly that these protocols are not intended to work in isolation. They should be implemented together. SPF alone cannot stop spoofing. DKIM alone cannot either. Only DMARC connects them to the address your customers see.
Why SPF Alone Fails
SPF has a blind spot. It checks the envelope sender, the hidden return address used for bounces. It does not check the From address shown in the email client.
An attacker can exploit this. They send mail from their own server with their own domain in the envelope. SPF passes, because their server is authorized for their domain. But they put your domain in the visible From line. The reader sees your business name. SPF never objects.
SPF also breaks when mail is forwarded. A mailing list or forwarding service can change the sending server. The message then fails SPF even though it is legitimate. This is one reason DMARC accepts either SPF or DKIM as a pass. A message that fails one can still pass through the other.
Why DKIM Alone Fails
DKIM proves a message was signed by someone holding a key for a domain. It does not prove that domain matches the one in the From line.
An attacker can sign a message with their own domain's key. The signature verifies fine. But the From line shows your domain. DKIM passes, and the reader is still fooled.
DKIM has another limit. It says nothing about whether the signer is authorized to send for the domain in the From line. That alignment check is DMARC's job.
How DMARC Ties It Together
DMARC requires alignment. For SPF, the envelope domain must match the visible From domain. For DKIM, the signing domain must match the visible From domain. If either one passes and aligns, DMARC passes.
DMARC also sets a policy for failures. The policy lives in a DNS TXT record at _dmarc.yourdomain.com. It has three levels.
| Policy | What it means | When to use it |
|---|---|---|
| p=none | Receivers take no action on failures, but send you reports | First step, while you learn who sends as your domain |
| p=quarantine | Failing mail goes to spam or junk | After reports show your real mail passes |
| p=reject | Receivers refuse failing mail outright | Final goal, once you are confident |
DMARC also sends you reports. Aggregate reports show which servers send mail as your domain and whether each stream passes or fails. Forensic reports give details on individual failures. Read the aggregate reports for at least a few weeks before tightening the policy.
How to Set Up SPF, DKIM, and DMARC
Follow this order. SPF and DKIM first, then DMARC at none, then tighten step by step.
- List every service that sends mail as your domain. Include your mail provider, your website, your newsletter tool, your invoicing system, and any CRM. Miss one, and its mail may start failing.
- Publish your SPF record. Add a DNS TXT record at your domain root. It starts with v=spf1 and lists your authorized senders, for example with include: entries for your providers. End with -all to reject unauthorized senders, or ~all for a softer start. Keep total DNS lookups under 10. Each include: counts as one.
- Enable DKIM signing. Your mail provider generates a key pair. Publish the public key as a DNS TXT record. The provider signs outgoing mail with the private key. Most providers offer a setup wizard for this step.
- Publish DMARC at p=none. Add a TXT record at _dmarc.yourdomain.com. Include a reporting address so you receive aggregate reports. A basic record looks like v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com.
- Read the reports. Watch for legitimate senders that fail. Fix their SPF or DKIM setup. Watch for unknown senders. Those may be spoofers, or services you forgot to list.
- Move to p=quarantine. Once your real mail passes consistently, tighten the policy. Failing mail now lands in spam instead of inboxes.
- Move to p=reject. This is the goal. Receivers refuse mail that fails DMARC. Spoofed mail from your domain stops reaching anyone.
Move slowly between steps. A rushed jump to reject can block your own invoices, password resets, and order confirmations. Weeks of reports at each stage are normal.
Common Setup Mistakes
Small errors cause big problems. Watch for these.
- More than one SPF record. A domain can have only one SPF TXT record. Multiple records break SPF entirely. Combine all senders into a single record.
- Too many DNS lookups. SPF allows 10 lookups. Too many include: entries exceed the limit and cause failures. Flatten or trim the list.
- Forgetting third-party senders. Your helpdesk, marketing tool, and ecommerce platform all need to be in SPF and DKIM. Check each one.
- Skipping the reporting address. Without rua= in your DMARC record, you get no reports. You are flying blind.
- Jumping straight to reject. Enforce only after your reports prove legitimate mail passes. Otherwise you block yourself.
- Ignoring subdomains. Attackers spoof subdomains too. Consider a DMARC policy that covers them, and publish SPF for subdomains that send no mail.
What About Gmail and Outlook Requirements?
Mailbox providers now enforce authentication for bulk senders. Gmail requires SPF or DKIM for all senders to Gmail addresses. It also requires valid forward and reverse DNS and a low spam rate. Microsoft requires SPF, DKIM, and DMARC for senders of more than 5,000 messages per day to Outlook.com addresses.
Even small senders benefit. Proper authentication improves deliverability. Mail from a domain with DMARC at reject is far less likely to land in spam.
Bottom Line
SPF lists your authorized senders. DKIM signs your mail so tampering shows. DMARC ties both to the From address your readers see and tells receivers what to do with failures. Set up SPF and DKIM, publish DMARC at none, read the reports, then tighten to quarantine and finally reject. Your domain becomes much harder to spoof, and your customers become much harder to phish.