Stop people sending email as your business: SPF, DKIM and DMARC
Last updated
The short answer
Three short DNS records let receiving mail servers tell real email from your business apart from forgeries. SPF lists who may send for your domain, DKIM signs your messages, and DMARC tells receivers what to do with mail that fails and sends you reports. Add SPF and DKIM through your email provider, start DMARC in monitoring mode, read the reports, then tighten it.
What SPF, DKIM and DMARC are
- SPF (RFC 7208) is a TXT record on your domain listing the servers allowed to send email for it: your email provider, plus any service that sends as you, such as a newsletter tool, an invoicing system or your website's contact form.
- DKIM adds a signature to each message your provider sends. The matching public key sits in your DNS, so a receiver can check the message really came from you and wasn't changed on the way.
- DMARC (RFC 7489) ties the two to the address people see in the From line, tells receivers what to do with a message that fails (nothing, spam folder, or reject), and asks them to send you reports.
Why it matters to a small business
Without these records anyone can send email that claims to come from your address: a fake invoice to your customers, a change of bank details to a supplier. Receiving providers check these records, and mail from a domain without them is more likely to be treated as suspicious, including your own real messages. Setting them up costs nothing but a few DNS entries.
How the free scan decides
The scan looks up your domain's DNS records:
- SPF record fails when the domain has no SPF record.
- DKIM / DMARC fails when DKIM or a DMARC policy is missing.
- MTA-STS policy enforces fails when the domain advertises MTA-STS but the policy file behind it is missing, unreadable or not set to enforce, and You hear about failed secure email delivery (TLS-RPT) when MTA-STS is enforced but no TLS-RPT record asks for failure reports.
- CAA records fails when no CAA record limits which certificate authorities may issue certificates for the domain.
Setting them up, by email provider
Each record is added where your domain's DNS is managed. That is not always where you bought the domain: if your site sits behind Cloudflare, for example, the records go in Cloudflare. Change only the records named here, and keep a note of anything you replace.
Google Workspace
- SPF: a TXT record on the domain itself (often entered as
@) with the valuev=spf1 include:_spf.google.com ~all. - DKIM: in the Google Admin console, generate the DKIM key for your domain, add it as the TXT record it shows (named
google._domainkeyby default), then return to the console and start authentication. Google's DKIM steps walk through it. - DMARC: a TXT record named
_dmarc, starting in monitoring mode (below). Google's DMARC page explains each part.
Microsoft 365
- SPF: a TXT record on the domain with
v=spf1 include:spf.protection.outlook.com -all. - DKIM: Microsoft gives you two CNAME records,
selector1._domainkeyandselector2._domainkey, whose values are unique to your organisation. Add them as shown in the Defender portal, then switch DKIM signing on there. Microsoft's DKIM steps show where. - DMARC: a TXT record named
_dmarc, as below; Microsoft's DMARC page covers the details.
Other providers, and services that send for you
Your provider's help pages give its SPF include: and its DKIM records. For each extra service that sends as your domain, add its include: to the same SPF record and set up its DKIM in that service's settings. Two rules from RFC 7208 trip people up: a domain must have only one SPF record (merge them; two are an error), and checking one may need no more than ten DNS lookups, so don't keep adding services you no longer use.
Type Name Value TXT @ v=spf1 include:_spf.google.com include:servers.newsletter-tool.example ~all TXT _dmarc v=DMARC1; p=none; rua=mailto:dmarc-reports@yoursite.com
A domain that never sends email can be forged too, so tell receivers it sends nothing: publish v=spf1 -all and v=DMARC1; p=reject on it.
Tightening DMARC safely
- Start with
p=noneand arua=mailto:address you read. Receivers then send daily summary reports listing the servers that sent mail as your domain. - Read the reports. Any service of yours that fails SPF or DKIM needs adding to SPF or setting up with DKIM; anything you don't recognise is either a service someone forgot or a forger.
- When the reports show only your own services passing, change to
p=quarantine, which sends failing mail to spam. - When that has run cleanly, change to
p=reject, which refuses forged mail outright.
Going straight to p=reject before step 2 can stop your own invoices or contact-form emails arriving, because a service you forgot to list fails too.
Three more records: MTA-STS, TLS-RPT and CAA
- MTA-STS tells other mail servers to deliver email to you only over an encrypted connection. It has two parts: a
_mta-stsTXT record and a policy file athttps://mta-sts.yoursite.com/.well-known/mta-sts.txtwithmode: enforce. A record without a working file protects nothing; if you didn't mean to use MTA-STS, remove the record. - TLS-RPT is one TXT record, named
_smtp._tls, with a value such asv=TLSRPTv1; rua=mailto:tls-reports@yoursite.com. Providers then report when they couldn't deliver to you securely. - CAA (RFC 8659) isn't about email, but lives in the same DNS settings. It names the certificate authorities allowed to issue https certificates for your domain, such as
0 issue "letsencrypt.org". List each authority you use, your CDN's included: one left off the list can no longer issue your certificate when it is due for renewal.
How to check yours
Run the free scan: the Security section shows the SPF, DMARC, MTA-STS and CAA records it found and what each one is missing. The sample report shows the layout. To test a real message, send one from your domain to a personal Gmail address, open it, and choose Show original: it lists SPF, DKIM and DMARC as PASS or FAIL. For your website's own settings, see the security settings guide.
Checklist
- One SPF record, listing your email provider and each service that sends as you.
- DKIM switched on with your email provider and each sending service.
- A DMARC record with a report address you read.
- DMARC raised to quarantine, then reject, once the reports show only your own mail.
- Unused domains publish v=spf1 -all and p=reject.
- Any MTA-STS record has a working policy file, and a TLS-RPT record beside it.
- A CAA record names each certificate authority you use.
What the free scan checks for this
These are the FocalScore checks that cover this guide's subject. Each one in your report says what it found, shows the evidence and gives the fix.
- SPF record
- DKIM / DMARC
- CAA records
- MTA-STS policy enforces
- You hear about failed secure email delivery (TLS-RPT)
Sources
Last checked . Documentation, settings and rules change; if one of these pages now says something different, it is right and this guide is out of date. Tell us at info@focalscore.com.
- RFC 7208: Sender Policy Framework (SPF)
- RFC 7489: DMARC
- Google Workspace Admin Help: Set up DKIM
- Google Workspace Admin Help: Set up DMARC
- Microsoft Learn: Set up DKIM for your Microsoft 365 domain
- Microsoft Learn: Set up DMARC for your Microsoft 365 domain
- RFC 8659: DNS Certification Authority Authorization (CAA)
More guides
- How to get your business recommended by ChatGPT and other AI assistants
- Why AI assistants can't see your website, and how to fix it
- robots.txt for small businesses: what to allow, what to block
- IndexNow explained: tell Bing about new pages, and who doesn't use it
- The pages every small-business website needs
- How to turn more website visitors into enquiries
- Why your site is slow, and what to fix first
- How your business shows up in Google: titles, descriptions and headings
- One address for each page: www, https, canonical tags and redirects
- A sitemap for any site, including one built by hand
- Making your site usable by everyone
- Making your site work on a phone
- Security settings for a small-business website, by platform
- Cookies and consent: what your site sets and when you need a banner
- How your links look when people share them
- Getting your business details right for Google Maps and AI assistants