Email deliverability: SPF, DKIM and DMARC set up step by step
SPF lists who may send as your domain, DKIM signs each message and DMARC says what to do on failure. Exact records for Google Workspace and Microsoft 365.
By Sohail Hussain21 November 20266 min read
SPF, DKIM and DMARC are three DNS records that let other mail servers check that email claiming to come from your domain really does. SPF lists the servers allowed to send as your domain. DKIM adds a signature to each message that only your sending services can create. DMARC tells receivers what to do when a message fails those checks, and sends you reports. Without them, more of your mail lands in spam, and anyone can send email that appears to come from you. With them, set up in the order below, both problems mostly go away.
The setup takes an hour of work spread over a few weeks, because the last step depends on reading reports. None of it costs anything.
What do SPF, DKIM and DMARC each do?
| Record | Where it lives | What it proves | Most common mistake |
|---|---|---|---|
| SPF | A TXT record on the domain itself | The sending server is on your approved list | Two SPF records, or more than 10 DNS lookups |
| DKIM | A TXT or CNAME record at selector._domainkey | The message was signed by a key you published and was not changed in transit | Turning it on for the mailbox provider but not for other senders |
| DMARC | A TXT record at _dmarc | SPF or DKIM passed for the same domain the reader sees in the From line | Jumping straight to reject before reading reports |
The idea that ties them together is alignment. SPF checks a hidden sender address that the recipient never sees. DKIM checks whichever domain signed the message. DMARC passes only if at least one of them passes for the domain in the visible From address. That is why a newsletter tool can pass SPF on its own domain and still fail DMARC for yours: it needs DKIM set up with your domain to align.
Do you really need all three?
Yes, for any business domain, as of October 2026. Google's email sender guidelines have required SPF or DKIM from everyone sending to Gmail since February 2024. Anyone sending more than 5,000 messages a day to Gmail must have all three, with DMARC at least at p=none, aligned From addresses, one-click unsubscribe on marketing mail, and a spam complaint rate below 0.3%. Since May 2025, Outlook.com has applied similar rules to senders of more than 5,000 messages a day to its consumer addresses.
A small business sending fifty emails a day is not a bulk sender. But unauthenticated mail is increasingly filtered or rejected regardless of volume, and DMARC is the only one of the three that stops someone impersonating your domain in invoices sent to your own customers. On sites under our website care and maintenance, these records are checked yearly and whenever a new tool starts sending email.
How do you set up SPF and DKIM?
Three steps, in this order. DMARC comes after, once these are working.
Step 1: list every service that sends as your domain
Before touching DNS, list everything that sends email with your domain in the From address:
- Your mailbox provider: Google Workspace, Microsoft 365 or Zoho.
- Your website's contact form, if it sends notifications from your domain.
- Newsletter and marketing tools.
- CRM, helpdesk and invoicing software.
- Anything else: booking systems, e-commerce platforms, payroll.
Forgotten senders are what break when you enforce DMARC. If a service sends a lot of marketing mail, Microsoft and others recommend giving it a subdomain such as news.example.com, so its reputation does not affect your staff's mail.
Step 2: publish one SPF record
A domain must have exactly one SPF record. For Google Workspace, Google's SPF instructions give:
v=spf1 include:_spf.google.com ~all
For Microsoft 365, Microsoft's SPF instructions give:
v=spf1 include:spf.protection.outlook.com -all
Add each other service by inserting its include: value, exactly as that service documents it, before the all at the end. Keep the total under 10 DNS lookups: each include: counts at least one, and some count several. Services that sign with DKIM on your domain often do not need to be in SPF at all, which keeps the record short.
Step 3: turn on DKIM for each sender
Google Workspace. In the Admin console, go to Apps, Google Workspace, Gmail, Authenticate email. Generate a 2048-bit key with the default selector google, publish it as a TXT record at google._domainkey, wait for it to appear, then click Start authentication.
Microsoft 365. In the Defender portal, go to Email & collaboration, Policies & rules, Threat policies, Email authentication settings, and open the DKIM tab. Select your domain and turn signing on. The portal shows two CNAME records, selector1._domainkey and selector2._domainkey, with values unique to your organisation. Create both at your DNS host, then turn signing on again once they are detected. Copy the values from the portal; Microsoft has changed their format for newer domains, so values from an old guide may be wrong.
Every other sender. Newsletter tools, CRMs and transactional email services each have a "domain authentication" page that gives you their DKIM records, usually CNAMEs. Add them all.
How do you roll out DMARC without blocking your own mail?
In two stages: report first, enforce later.
Step 4: publish DMARC at p=none and read the reports
Wait 48 hours after SPF and DKIM are in place, then add a TXT record at _dmarc.yourdomain.com:
v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com
p=none means "change nothing, just report". rua is where daily aggregate reports go. Use a dedicated mailbox or group, not a person's inbox; reports arrive as zipped XML files from every major receiver. A DMARC report reader, many with free tiers, turns them into a list of who sent mail as your domain and whether it passed.
For two to four weeks, look for legitimate services that fail and fix them, usually by adding their DKIM records. Ignore unknown servers in other countries that fail: that is spoofing, and it is what the next step blocks.
Step 5: move to quarantine, then reject
When only unauthorised mail is failing, tighten the policy:
v=DMARC1; p=quarantine; rua=mailto:dmarc-reports@yourdomain.com
Quarantine asks receivers to put failing mail in spam. Watch the reports for another two weeks. If nothing legitimate is caught, finish with:
v=DMARC1; p=reject; rua=mailto:dmarc-reports@yourdomain.com
Keep reading the reports monthly. New tools get added, and the first sign of a forgotten one is usually a customer saying they never got your invoice. Google's DMARC guide covers the optional tags, including pct for applying a policy to part of your mail while you test.
How do you check it is working?
Send an email to a Gmail address, open it, and choose "Show original" from the message menu. You should see SPF, DKIM and DMARC each marked PASS. Do this for each service that sends as your domain, not only your mailbox.
From a terminal, dig +short TXT yourdomain.com and dig +short TXT _dmarc.yourdomain.com show what is published. DNS explained for business owners covers the tools in more detail.
Two extra habits are worth the minute they take. Domains you own but never send from should publish v=spf1 -all and a DMARC record with p=reject, so nobody can use them for phishing. And keep signatures light: one small logo and a few links, built with something like the email signature generator, rather than large images that bloat every message.
If you are setting up email from scratch, start with how to set up business email with your domain, then come back here. The yearly check of these records belongs in the routine in the website maintenance guide.
Was this guide useful?