If your business emails keep landing in spam, or clients say they never received your invoice, the cause is often three missing DNS records: SPF, DKIM and DMARC. They prove to Gmail, Outlook and other providers that your emails really come from you.
They’re no longer optional. Google, Yahoo and Microsoft now expect proper email authentication from senders, and messages without it are far more likely to be filtered or rejected. These records also make it much harder for scammers to send fake emails from your domain.
If your domain uses Cloudflare for DNS, setup takes about 20 minutes. This guide covers both Google Workspace and Microsoft 365, step by step.
Still setting up your business email? Start with our guide to professional email with Google Workspace.
What Each Record Does
| Record | What it does | Simple analogy |
| SPF | Lists which servers are allowed to send email for your domain | A guest list at the door |
| DKIM | Adds a digital signature to each email, proving it wasn’t changed | A sealed, signed envelope |
| DMARC | Tells receivers what to do if SPF or DKIM fails, and sends you reports | The rule for what happens to uninvited guests |
You need all three. SPF and DKIM prove your emails are genuine; DMARC ties them together and protects your domain from being faked.
Before You Start
You’ll need:
- Admin access to your Cloudflare account, with your domain’s DNS managed there.
- Admin access to Google Workspace or Microsoft 365.
- Your MX records already set up, so email is working.
- A list of any other services that send email as your domain, such as a newsletter tool, CRM, invoicing app or website contact form.
If you’re new to DNS, our guide to domains, hosting and DNS explains the basics, and Cloudflare for beginners covers the dashboard.
How to add a record in Cloudflare
You’ll repeat these steps for each record below:
- Log in to Cloudflare and select your domain.
- Go to DNS → Records.
- Click Add record.
- Choose the Type (TXT or CNAME), enter the Name and Content exactly as given, and leave TTL on Auto.
- For CNAME records, set Proxy status to DNS only (grey cloud). Email records must never be proxied.
- Click Save.
In Cloudflare’s Name field, @ means your main domain, such as yourdomain.com.
Step 1: Add Your SPF Record
First, check whether you already have one. In DNS → Records, look for a TXT record on @ that starts with v=spf1. A domain must have only one SPF record. If one exists, edit it instead of adding a second.
For Google Workspace
| Field | Value |
| Type | TXT |
| Name | @ |
| Content | v=spf1 include:_spf.google.com ~all |
For Microsoft 365
| Field | Value |
| Type | TXT |
| Name | @ |
| Content | v=spf1 include:spf.protection.outlook.com -all |
If other services send email for you
Add each service’s include: inside the same record, before the ~all or -all. For example, Google Workspace plus a newsletter tool might look like:
v=spf1 include:_spf.google.com include:servers.mcsv.net ~all
Each service lists its own include value in its help pages. Keep it to the services you actually use: SPF allows a maximum of 10 DNS lookups, and too many includes break it.
Step 2: Set Up DKIM
DKIM is set up in two places: you generate a key in your email provider, then publish it in Cloudflare.
For Google Workspace
- Sign in to the Google Admin console (admin.google.com).
- Go to Apps → Google Workspace → Gmail → Authenticate email.
- Select your domain and click Generate new record. Choose a 2048-bit key and keep the prefix as google.
- Google shows a DNS Host name (_domainkey) and a long TXT record value starting with v=DKIM1;.
- In Cloudflare, add a record:
| Field | Value |
| Type | TXT |
| Name | google._domainkey |
| Content | The full value Google gave you |
- Wait 15 to 60 minutes, go back to the Admin console and click Start authentication. The status should change to “Authenticating email”.
Copy the whole value carefully. It’s long, and missing even one character breaks DKIM.
For Microsoft 365
- Go to the Microsoft Defender portal (security.microsoft.com).
- Open Email & collaboration → Policies & rules → Threat policies → Email authentication settings → DKIM.
- Select your domain. Microsoft shows two CNAME records, for _domainkey and selector2._domainkey.
- In Cloudflare, add both as CNAME records, copying the Name and Target exactly as Microsoft shows them:
| Field | Value |
| Type | CNAME |
| Name | selector1._domainkey (then repeat for selector2) |
| Target | The value Microsoft shows for each selector |
| Proxy status | DNS only (grey cloud) |
- Back in the Defender portal, turn on Sign messages for this domain with DKIM signatures. If it says the records aren’t found, wait a while and try again.
The exact target format depends on your Microsoft 365 setup, so always copy it from the portal rather than typing it from a guide.
Step 3: Add Your DMARC Record
Once SPF and DKIM are in place, add DMARC. The record is the same for Google Workspace and Microsoft 365.
| Field | Value |
| Type | TXT |
| Name | _dmarc |
| Content | v=DMARC1; p=none; rua=mailto:[email protected] |
Replace [email protected] with a real mailbox or group that can receive reports. You can create a dedicated address for this, because the reports arrive as daily email attachments.
What the policy means
- p=none: monitor only. Nothing is blocked, and you receive reports. Always start here.
- p=quarantine: emails that fail go to spam.
- p=reject: emails that fail are blocked completely.
Tighten it over a few weeks
- Keep p=none for 2 to 4 weeks and read the reports. They show every service sending email as your domain.
- Add any legitimate service you’d forgotten to SPF, and set up DKIM for it if it supports it.
- Change to p=quarantine once your real emails pass.
- Move to p=reject when you’re confident. This gives your domain the strongest protection against fake emails.
DMARC reports are hard to read raw. Cloudflare offers free DMARC Management under Email → DMARC Management in your domain’s dashboard, which turns reports into simple charts. Free tools from other providers can do the same.
Step 4: Test Everything
DNS changes usually work within minutes on Cloudflare, though some providers take a few hours to see them.
- Send a test email from your business address to a personal Gmail account.
- In Gmail, open the email, click the three dots and choose Show original.
- Check that SPF, DKIM and DMARC all show PASS.
You can also use free checkers such as Google Admin Toolbox’s Check MX or MXToolbox to look up each record.
Common Mistakes to Avoid
- Two SPF records. Only one is allowed. Merge them into one.
- Proxied CNAME records. Microsoft’s DKIM CNAMEs must be set to DNS only (grey cloud).
- Typos in the DKIM value. Copy and paste the full key; never retype it.
- Jumping straight to p=reject. Start with p=none, or you may block your own newsletters or invoices.
- Forgetting other senders. Newsletter tools, CRMs and website forms need to be included in SPF and, ideally, set up with DKIM.
- Too many SPF lookups. More than 10 includes makes SPF fail. Remove services you no longer use.
These records also protect you from phishing that pretends to come from your domain. Read how to spot phishing emails and what to do if your business email is hacked for the rest of your email security.
Related guides: Small Business Cybersecurity: The Complete Guide
FAQ
Do I really need SPF, DKIM and DMARC for a small business?
Yes. Without them, your emails are more likely to land in spam, and anyone can send fake emails that look like they come from your domain. Major providers like Gmail and Outlook now expect all three.
Can I have more than one SPF record?
No. A domain must have exactly one SPF record. If you use several email services, combine them in one record with multiple include: entries.
Should my email records be proxied in Cloudflare?
No. TXT records can’t be proxied anyway, and CNAME records used for DKIM must be set to DNS only (grey cloud), or they won’t work.
How long does it take for the records to work?
On Cloudflare, usually a few minutes. Google and Microsoft may take up to an hour or two to detect DKIM, so wait before clicking Start authentication or enabling signing.
What DMARC policy should I use?
Start with p=none to monitor. After a few weeks of clean reports, move to p=quarantine, then p=reject for full protection.
Will this fix emails going to spam?
It fixes the most common technical cause. If emails still land in spam, check that your content isn’t spammy, your domain isn’t on a blocklist, and recipients aren’t marking your emails as spam.
Final Word
SPF, DKIM and DMARC sound technical, but in Cloudflare they’re just three or four DNS records. Add SPF first, set up DKIM in Google Workspace or Microsoft 365, then add DMARC in monitor mode. Check the reports for a few weeks and tighten the policy step by step.
It’s about 20 minutes of work that helps every email you send reach the inbox, and makes your domain much harder for scammers to fake.


