SPF, DKIM and DMARC are three DNS-based checks that let a receiving mail server confirm that an email really came from the domain it claims to come from. SPF lists which servers are allowed to send for your domain, DKIM adds a cryptographic signature to every message, and DMARC tells receivers what to do when those checks fail and sends you reports about it.
You set them up once as a handful of DNS records, then keep an eye on them. Without them, mailbox providers have little reason to trust your mail, and since February 2024 Gmail and Yahoo expect them from bulk senders (we cover the details in our guide to Gmail and Yahoo sender requirements).
If you only remember a few things from this guide, make it these:
- SPF authorises sending servers, DKIM signs each message, and DMARC sets the policy and sends reports.
- You need only one SPF record per domain, and it must stay within 10 DNS lookups.
- Start DMARC at
p=none, read the reports, then tighten to quarantine and finally reject. - DMARC passes only when SPF or DKIM passes and the domain it checked lines up with your visible From address.
- Always test with a real message after any DNS change.
What do SPF, DKIM and DMARC actually do?
Email was designed when nobody checked who was really sending a message, so anyone can type any From address, which is how spoofing works. These three standards close that gap. An analogy helps. Imagine your business sends letters through the post and the receiving office wants to know which ones are genuinely yours.
- SPF is the list of approved couriers pinned up at the receiving office's front desk. If a letter arrives with your name on it but was delivered by a courier who is not on your list, that is suspicious.
- DKIM is the wax seal on the envelope. Only you hold the signet ring, and anyone can look up a picture of the genuine seal. An intact seal proves the letter came from you and has not been opened or altered on the way.
- DMARC is your standing instruction to the front desk. It says: if a letter fails the courier check and the seal check, here is what to do with it (deliver it anyway, put it to one side, or bin it), and please send me a daily note about what you saw.
What is SPF?
SPF stands for Sender Policy Framework. You publish a DNS record that names the servers and services allowed to send mail for your domain. When a message arrives, the receiving server looks at the domain in the hidden envelope sender (the Return-Path address, not the From address people see) and checks whether the sending server is on that domain's list.
What is DKIM?
DKIM stands for DomainKeys Identified Mail. Your sending service holds a private key and signs each outgoing message, covering selected headers and the body. You publish the matching public key in DNS under a name called a selector. The receiving server fetches that public key and checks the signature. If anyone changed the message in transit, the check fails.
What is DMARC?
DMARC stands for Domain-based Message Authentication, Reporting and Conformance. It sits on top of SPF and DKIM. It does two jobs: it states a policy (none, quarantine or reject) for messages that fail, and it asks receivers to send you aggregate reports showing who is sending mail using your domain. It also introduces the idea of alignment, which we cover below.
What do SPF, DKIM and DMARC records look like?
All three are DNS TXT records (DKIM is sometimes published as a CNAME that points to your provider). The examples below use the placeholder domain example.com and made-up values. Do not copy them: your sending provider will give you the real values.
Example SPF record (host:
example.com, type: TXT)
v=spf1 include:spf.sendingprovider.example.net ~allExample DKIM record (host:
s1._domainkey.example.com, type: TXT)
v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A...(public key shortened)Example DMARC record (host:
_dmarc.example.com, type: TXT)
v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com
In plain words: the SPF record says "this provider's servers may send for me; treat anything else as a soft fail". The DKIM record publishes a public key under the selector s1. The DMARC record says "take no action yet, but send aggregate reports to this mailbox".
| Record | Where it lives | What it proves | What a failure means |
|---|---|---|---|
| SPF | TXT record on your domain | The sending server is authorised by the envelope-sender domain | Mail came from a server you did not list, or your record is broken |
| DKIM | TXT (or CNAME) at selector._domainkey | The message was signed by the domain and not altered | No valid signature, wrong key, or the message was modified in transit |
| DMARC | TXT record at _dmarc | SPF or DKIM passed and aligned with the From domain | Receiver applies your policy: none, quarantine or reject |
How do you set up SPF, DKIM and DMARC step by step?
The order matters a little: get SPF and DKIM working first, because DMARC depends on them.
- List every system that sends email as your domain. That usually means your email marketing platform, your website or shop's transactional mail, your office mailbox provider, and perhaps a helpdesk or invoicing tool. Missing one is the most common cause of surprise failures later.
- Get the DNS records from your sending provider. Marketing platforms and sending services publish the exact SPF include and DKIM records they need for your domain.
- Publish one combined SPF record. Merge every provider's include into a single record on the root of your domain, ending with
~all(soft fail) while you are testing. - Publish the DKIM record or records. Add each selector exactly as given. Where you have a choice, prefer 2048-bit keys, but check that your DNS host can store the longer value.
- Send a test message and read the headers. Look for
spf=passanddkim=passbefore moving on. - Publish DMARC at
p=nonewith a reporting address. This changes nothing about delivery yet. It simply starts the flow of reports. - Review reports for a few weeks, fix legitimate senders that fail, then tighten the policy. The next sections explain the progression.
What are the most common SPF, DKIM and DMARC mistakes?
Publishing more than one SPF record
A domain may have only one SPF record. If you add a second TXT record starting with v=spf1 every time you adopt a new tool, receivers treat the result as an error and SPF fails for everyone. Merge them into one record with several include: mechanisms.
Exceeding the 10-lookup limit
SPF allows at most 10 DNS lookups while evaluating a record. Mechanisms such as include, a, mx and exists, and the redirect modifier, each count, and includes can nest inside other includes. Go over the limit and receivers return a permanent error, which counts as a failure. Remove services you no longer use and avoid piling on includes you do not need.
Jumping straight to p=reject
A strict DMARC policy on day one can quietly block your own invoices, helpdesk replies or newsletters if one sender was forgotten. Old tools linger, and reports at p=none reveal them.
Confusing the soft fail and hard fail endings
~all means soft fail and -all means hard fail. Many senders start with ~all and move to -all once they are confident the list is complete. With DMARC in place, the difference matters less than people expect.
What is DMARC alignment and why does it trip people up?
DMARC does not just ask "did SPF or DKIM pass?". It asks whether the domain that passed matches the domain in the From address your reader sees. That match is called alignment.
For SPF, the envelope-sender domain must match the From domain. For DKIM, the domain named in the signature (the d= value) must match the From domain. Matching can be relaxed (a subdomain such as mail.example.com aligns with example.com) or strict (an exact match only). Relaxed is the default and suits most senders.
The classic failure is a message that passes SPF for the provider's own domain but shows your domain in the From line. SPF passed, but not for your domain, so it does not align. Signing with your own domain through DKIM, usually by completing your provider's domain verification, fixes this. Either one can carry DMARC, but both aligned is sturdier, especially when forwarding breaks SPF.
How do you move DMARC from p=none to quarantine and reject?
Treat the policy as a dial you turn slowly.
- Monitor (
p=none). Collect aggregate reports for a few weeks. Identify every source and make sure each legitimate one passes with alignment. - Quarantine (
p=quarantine). Failing mail is typically sent to the spam folder. Many teams use thepct=tag to apply the policy to a fraction of failing mail first, then raise it. - Reject (
p=reject). Failing mail is refused outright. This gives the strongest protection against people spoofing your domain, and it is where most established senders aim to finish.
Move on when the evidence says so, not by the calendar. If legitimate mail still fails in the reports, stay put and fix it.
How do you test your SPF, DKIM and DMARC setup?
- Send yourself a test message to a Gmail address, open the message, choose "Show original" and look for PASS next to SPF, DKIM and DMARC.
- Query the records directly, for example
dig TXT example.comfor SPF anddig TXT _dmarc.example.comfor DMARC (swap in your own domain). - Use an online record checker to catch syntax errors and duplicate SPF records.
- Read your DMARC aggregate reports. They arrive as XML files, so most people use a report viewer to make sense of them. Retest after every change.
How does Beacon check and explain SPF, DKIM and DMARC?
Beacon checks your SPF, DKIM and DMARC records for you and explains each result in plain language, with the next step to take when something is off. If your domain's DNS is hosted on Cloudflare or GoDaddy, Beacon can set the records up automatically instead of asking you to paste values by hand.
Because Beacon lets you bring your own sending provider (Amazon SES, Resend or your own SMTP), the records you publish depend on that provider, and Beacon's checks tell you whether they are in place. It also runs a verified-domain check on every send, and gives you a 0 to 100 reputation score with concrete next steps. Once authentication is solid, the next job is building volume safely, which our email warmup guide covers, and if mail still lands in the wrong folder, work through our checklist for stopping emails going to spam.
Frequently asked questions
Do I need SPF, DKIM and DMARC if I only send a small newsletter?
Yes. A small sender with missing records looks no different from a spoofer, and the work is the same whether you send fifty emails or fifty thousand.
What is the difference between SPF and DKIM?
SPF checks the sending server against a list you publish, while DKIM checks a signature attached to the message itself. SPF can break when mail is forwarded because the forwarding server is not on your list, whereas DKIM usually survives forwarding as long as the message is not altered.
Can I have two SPF records?
No. A domain must have a single SPF record, and having two causes SPF to fail. If you use several services, combine their include statements into one record and watch the 10-lookup limit.
Which DMARC policy should I use?
Start with p=none to gather reports without affecting delivery, then move to p=quarantine and eventually p=reject once all your legitimate mail passes with alignment. The right pace depends on how many systems send mail for your domain.
Get your authentication sorted with Beacon
If you would rather not wrestle with DNS by yourself, start free and let Beacon check and explain your records in plain English. You can also see what is included on the pricing page.




