How to set up SPF, DKIM and DMARC records
SPF, DKIM and DMARC are three DNS records that prove your emails really come from your business. Setting them up takes about half an hour in your domain's DNS settings, and it's the single biggest fix for emails going to spam.
Last updated · By the XKey team
What do SPF, DKIM and DMARC do?
- SPF lists the services allowed to send email for your domain.
- DKIM adds a digital signature to each email so receivers can check it wasn't forged or changed.
- DMARC tells receivers what to do when an email fails those checks, and sends you reports about who is sending as your domain.
You add all three where your domain's DNS is managed – often your domain registrar (GoDaddy, IONOS, 123 Reg, Namecheap) or Cloudflare. Our DNS lookup shows who hosts your DNS.
How do I set up SPF?
Add one TXT record on your root domain (shown as @). Start it with v=spf1, add an include for each service that sends email for you, and end with ~all or -all:
- Microsoft 365:
v=spf1 include:spf.protection.outlook.com -all - Google Workspace:
v=spf1 include:_spf.google.com ~all - Both, plus a newsletter tool: one record with several includes, using the include each provider gives you in its help pages.
Never create two SPF records – combine them into one. Keep under 10 DNS lookups in total. Test it with the SPF checker.
How do I set up DKIM?
- Microsoft 365: in the Microsoft Defender portal, open Email authentication settings → DKIM, choose your domain, copy the two CNAME records it shows (selector1 and selector2) into your DNS, then switch signing on.
- Google Workspace: in the Admin console, go to Apps → Google Workspace → Gmail → Authenticate email, generate a key, add the TXT record it shows (usually at
google._domainkey), then press Start authentication. - Other services (Mailchimp, Xero, booking systems): look for "authenticate your domain" in their settings; each gives you its own records.
Check each one with the DKIM checker using the selector your provider gave you.
How do I set up DMARC?
Add a TXT record named _dmarc. Start in monitoring mode:
v=DMARC1; p=none; rua=mailto:dmarc@example.co.uk
Reports arrive at that address showing every service sending as your domain. Once everything you use passes SPF or DKIM, tighten the policy to p=quarantine, then p=reject, which stops others sending forged emails as your business. Check it with the DMARC checker, and see how to set up DMARC for reading reports and moving safely to p=reject.
What are the most common setup mistakes?
- Two SPF records instead of one.
- Forgetting a service, such as a website contact form or invoicing app.
- Jumping straight to
p=rejectbefore checking reports, so real emails get blocked. - Typing the record name as
_dmarc.example.co.ukin a DNS panel that adds the domain itself, creating_dmarc.example.co.uk.example.co.uk.
Still landing in spam after this? See why are my emails going to spam?.
Frequently asked questions
How long do SPF, DKIM and DMARC take to work?
Usually within an hour, although DNS changes can take up to 48 hours to reach everywhere.
Do I need DMARC if I only send a few emails?
It's strongly recommended. It's free, protects your name from being used in scam emails and helps your emails reach the inbox.
Does a domain that never sends email need these records?
Yes – add an SPF record of v=spf1 -all and a DMARC record with p=reject so nobody can send forged email from it.
Related guides
Gmail, Yahoo and Microsoft sender rules
The sender rules Gmail, Yahoo and Outlook enforce: SPF, DKIM, DMARC, one-click unsubscribe and spam rates, in plain English for small businesses.
How to set up Google Search Console
Set up Google Search Console in 15 minutes: choose a property type, verify your site, submit a sitemap and learn the four reports that matter most.
Google Business Profile guide
How to create, verify and get the most from a free Google Business Profile: categories, service areas, video verification, photos, posts and reviews.
Run a free SEO check now
About 50 checks covering Google, AI search, speed, security and local SEO. No sign-up.
Want the fixes done for you? XKey is made by IceWork, a web studio in Blackpool. IceWork builds fast, search-ready websites – a 3-page site including domain and a year's hosting is £350 all in.