Short answer: SPF lists who may send mail for your domain, DKIM signs each message, and DMARC tells receivers what to do when those checks fail. Publish SPF, turn on DKIM, then start DMARC with p=none and tighten it later.
If email from your domain lands in spam, or someone sends fake mail pretending to be you, the fix lives in DNS. Three records do the work: SPF, DKIM and DMARC. If a fake message still lands in your inbox, our guide on how to spot a phishing email shows what to check and what to do if you clicked.
What each one does
- SPF lists the servers allowed to send mail for your domain.
- DKIM adds a cryptographic signature to each message, so the receiver can check it was not altered and really came from your domain.
- DMARC tells receiving servers what to do when SPF and DKIM checks fail, and sends you reports.
Gmail and Yahoo have required authentication for bulk senders since 2024, and a correct setup also helps ordinary business mail reach the inbox.
SPF
SPF is a TXT record on your root domain. A typical one for a domain that sends through Google Workspace looks like this:
v=spf1 include:_spf.google.com ~all
Rules to remember:
- A domain can have only one SPF record. Two records make SPF fail. Merge them.
- SPF allows at most 10 DNS lookups. Every
include:counts, so long lists of services can break it. ~allis a soft fail.-allis a hard fail. Start with~all.
DKIM
Your mail provider generates the key. In Google Workspace it is in the admin console under Gmail authentication. In Microsoft 365 you publish two CNAME records. The provider shows exactly what to add. After adding it, turn signing on in the provider, then send a test message and check the headers for dkim=pass.
DMARC
DMARC is a TXT record at _dmarc.yourdomain.com. Start in monitoring mode:
v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com
p=none changes nothing about delivery. It only starts reports arriving, so you can see who sends mail as your domain.
A safe rollout order
- Publish SPF and enable DKIM for every service that sends mail for you: your mailbox provider, your newsletter tool, your invoicing system.
- Publish DMARC with
p=noneand read the reports for two to four weeks. - Fix any legitimate sender that fails.
- Move to
p=quarantine, optionally withpct=25first, then raise the percentage. - When reports are clean, move to
p=reject.
Skipping step 2 is the most common mistake. Going straight to p=reject blocks your own invoices or newsletters when one sender was missed.
How to test
Send a message to a Gmail address, open Show original, and look for SPF: PASS, DKIM: PASS and DMARC: PASS. Free checkers such as Google Admin Toolbox or MXToolbox read your DNS and flag duplicate SPF records and lookup overruns.
Common problems
- SPF "too many lookups": remove services you no longer use, or flatten includes.
- DKIM fails after a provider change: the old selector record was deleted, or signing was never switched on.
- DMARC passes SPF but fails alignment: the visible From domain must match the domain that passed SPF or DKIM.
Email authentication is dull work, but it is one of the few changes that protects your brand and your inbox placement at once.
Frequently asked questions
Can a domain have two SPF records?
No. Two SPF records make SPF fail. Merge all sending services into one record, and stay under the limit of 10 DNS lookups.
Is DMARC p=none safe to start with?
Yes. p=none does not change how mail is delivered. It only starts sending you reports so you can see who sends mail as your domain before you move to a stricter policy.
Discussion
Loading comments...