SPF Record Setup for a Small Business: Step by Step
How to set up an SPF record for your business domain, including Microsoft 365: the exact record, where to add it, how to test it and the mistakes to avoid.

An SPF record is a single line of text in your domain’s DNS settings that lists which services are allowed to send email as your business. To set one up, list every service that sends mail from your domain, build one record that includes them all, add it as a TXT record at the company that manages your DNS, and test it. For a business using only Microsoft 365, the record is v=spf1 include:spf.protection.outlook.com -all. Most problems come from having two records, forgetting a sender or copying a record that does not match how you actually send mail.
This guide is for owners and office managers who run their own domain, such as yourbusiness.ie, and want invoices, quotes and replies to reach customers’ inboxes. hostme.ie is a one-person IT service for Irish sole traders and small businesses, and we work with business email and domains every week, so the steps below are the practical ones.
TL;DR
- SPF is a DNS TXT record that names the services allowed to send email for your domain. Microsoft describes it as identifying valid mail sources, which receiving servers check.
- A domain must have one SPF record only. If you use Microsoft 365 plus another sender, merge them into that single record.
- For Microsoft 365 alone, the record is
v=spf1 include:spf.protection.outlook.com -all. Add it at your registrar or DNS host, not in the Microsoft 365 admin centre. - List every sender before you tighten the ending of the record: invoicing software, newsletter tools, booking systems and website forms all count.
- SPF works best alongside DKIM and DMARC. Set SPF up first, then add the others.
Table of Contents
- What an SPF record does
- Before you start: four checks
- Build your SPF record
- Add the record to your DNS
- Test the record
- Fixing the common problems
- SPF, DKIM and DMARC together
- A worked example
- Our view on SPF for small businesses
- If you would rather hand it over
- FAQ
- Sources
What an SPF record does
Email was designed without a check on who is really sending a message. Anyone can type your address into the “from” field. SPF (Sender Policy Framework) is one way receiving mail systems check. When a message arrives claiming to be from your domain, the receiving server looks up your SPF record and asks whether the sending server is on your list. If it is not, the message may be marked as spam or rejected.
The record is a DNS TXT record. DNS is the public address book for your domain, and a TXT record is a free-text entry in it. Microsoft’s documentation explains that receiving systems use SPF to verify the envelope sender address, which is the technical return address rather than the name a person sees in their inbox. The basic layout is v=spf1, then the valid mail sources, then an enforcement rule.
If you want a plain-English tour of the other records around it (MX, CNAME, TXT), our guide to DNS records for small business owners covers them.
Before you start: four checks
Ten minutes of preparation saves most of the trouble later.
- Find out who manages your DNS. This is usually your domain registrar or web host. It is the place where you edit records, and it may not be where you bought the domain. If you are unsure, your domain’s nameservers show who runs the DNS.
- Look for an existing SPF record. Many domains already have one, added by a web host or an earlier email setup. You will edit it, not add a second.
- List every service that sends email as your domain. Think beyond your mailboxes: accounting or invoicing software, a newsletter tool, an online booking system, a helpdesk, a shop, and the contact form on your website.
- Note any subdomains that send mail. Microsoft states that each subdomain used to send email needs its own SPF TXT record.
That sender list is the most important part of the job. The record itself is one line. Getting the list right is what decides whether your genuine email arrives.
Build your SPF record
An SPF record is made of parts, read left to right.
| Part | What it means | Example |
|---|---|---|
v=spf1 |
Starts every SPF record | v=spf1 |
include: |
Allows a provider’s mail servers | include:spf.protection.outlook.com |
ip4: |
Allows a specific IP address, such as an office server or printer | ip4:203.0.113.25 (a documentation example) |
-all or ~all |
What to do with anything not listed | -all |
Microsoft 365 only
Microsoft’s own example is v=spf1 include:spf.protection.outlook.com -all. This is the record to use if every message from your domain is sent through Microsoft 365.
Microsoft 365 plus Google Workspace
Google’s help pages give the combined record as v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all, and note that a record can hold up to 10 include tags. Most small businesses use one or the other, but a business part-way through a move can have both for a while. Our comparison of Microsoft 365 and Google Workspace helps if you are still choosing.
Microsoft 365 plus another sender
Say you also send invoices from accounting software. You do not add a second record. You add the other provider’s include to the same line, before the ending:
v=spf1 include:spf.protection.outlook.com include:your-invoicing-provider.example -all
The second include here is a placeholder. Your provider’s help page gives the exact value to use. Only add includes you understand: each one authorises everything that provider’s range can send, so use the value the provider publishes for SPF and nothing else.
Choosing the ending: -all or ~all
The last part tells receivers what to do with mail from a server not on your list. -all is a hard fail: it says the mail is not authorised. ~all is a soft fail: it says the mail is suspicious but is a weaker signal. Microsoft’s example uses -all, and Google’s combined example uses ~all. Neither ending guarantees a particular delivery result, because the receiving server makes the final call.

A sensible approach for a business that is not yet sure of its sender list is to start with ~all, confirm every legitimate sender is included, then move to -all. Never end a record with +all, which allows anyone to send as you.
Avoid the 10-lookup limit
SPF allows no more than 10 DNS lookups. Microsoft warns that going over causes a permanent error, and the message can bounce with wording such as “too many lookups”. Each include: counts, and the includes inside those includes count too. A small business with Microsoft 365 and two or three other tools is normally well within the limit. If you keep adding tools over the years, remove includes for services you no longer use.
Add the record to your DNS
There is one point that catches many people: Microsoft states that there is no admin portal setting or PowerShell command in Microsoft 365 for managing SPF. You create the record at your domain registrar or DNS hosting service.
The steps are much the same everywhere, although menu names differ:
- Sign in to the control panel where your DNS is managed.
- Open the DNS or zone records page.
- Look for any existing record whose value starts with
v=spf1. If there is one, edit it. Do not add another. - If there is none, add a new record of type TXT.
- For the host or name, enter
@, which means the root domain. Some panels want the field left blank, or your full domain name. The panel’s help text will say which. - Paste the value, for example
v=spf1 include:spf.protection.outlook.com -all. - Set the TTL. Microsoft recommends a minimum of 3600 seconds (one hour) for SPF records. TTL is how long other servers keep a copy before checking again.
- Save.
Microsoft’s guide for Cloudflare, connecting DNS records to Microsoft 365, shows the same pattern: a TXT record at @ with the Microsoft include, and a note that if an SPF record already exists you add the Microsoft values to it rather than creating a new one.
Where it goes wrong:
- Pasting a second record. Two SPF records invalidate each other and SPF checks fail. Merge into one.
- Typing errors. A missing colon after
include, a stray space or smart quotes pasted from a document can all break the record. - Editing the wrong DNS. If your website is hosted with one company but your nameservers point to another, changes made in the first place have no effect.
- Forgetting the subdomain. If a tool sends from
news.yourbusiness.ie, that subdomain needs its own record.
The records for your mail flow sit close to each other in DNS, so if you are also moving mailboxes, check the MX records at the same time. Our business email setup and migration checklist lists what to confirm before you change anything.
Test the record
DNS changes can take a while to reach everyone, so test after a short wait.
Look the record up. Any online SPF checker will show it. If you are comfortable with a command line, dig +short yourbusiness.ie TXT lists the TXT records for the domain, and you should see exactly one starting v=spf1.
Send a real test. Send an email from your business address to an outside address you control, such as a personal webmail account. Open the message’s full headers (the “show original” or “view message source” option, depending on the mail service) and find the line showing the SPF result. You are looking for spf=pass. A softfail means the record uses ~all and the sending server was not listed. A fail means the server is not in the record. A permerror points to a structural problem such as more than one record, a syntax error or too many lookups.
Test each system that sends as your domain, not just Outlook. The invoice from your accounting package and the enquiry sent by your website form are the ones most often missed.
Fixing the common problems
Emails from your website form go to spam. Many websites send form messages through the web server, not through your mail provider. That server is then sending as your domain and is not in your record. The fix is either to add the correct include or IP, or to send form mail through your mail provider’s authenticated service.
A new tool stopped working after a month. You added a booking system or newsletter tool and did not update the record. Add that tool’s include to the existing single record.
SPF passes but mail still lands in spam. SPF is one check among several. Microsoft’s guidance frames it as part of a set: where it is hard to identify every valid sender, it recommends configuring DKIM signing and DMARC in a “take no action” mode so that DMARC reports show you unknown sources and failures. That is the sensible order for a small business too.
Forwarded mail fails SPF. SPF checks the server that delivers the message. When a message is forwarded, the forwarding server is not in your record. This is a known limit of SPF, and it is one reason DKIM exists alongside it.
SPF, DKIM and DMARC together
Three short definitions:
- SPF says which servers may send mail for your domain.
- DKIM adds a digital signature to each message so the receiver can check it was not altered and really came from your domain. In Microsoft 365 you publish two CNAME records that Microsoft gives you, then turn DKIM signing on for the domain in the Defender portal.
- DMARC tells receivers what to do when SPF and DKIM checks fail, and sends you reports.
A workable order for a small business is: SPF first, with a complete sender list; then DKIM for each service that signs mail; then DMARC set to monitoring only; and tighten later, once the reports show only genuine senders. Rushing to a strict policy before every genuine sender is authenticated is how real invoices and booking confirmations end up rejected.
If you want to see how the pieces fit into one email authentication setup, this email deliverability guide walks through it for organisations that send member and booking emails.
If you use Google Workspace, our Google Workspace security guide covers the account side of protecting email.
A worked example
This is a fictional example, for illustration only. A small joinery business in Mayo uses Microsoft 365 for mailboxes, sends quotes from an online quoting tool and sends a monthly newsletter through a mailing service. Its web host once added a default SPF record that mentions only the host’s own servers.
- The owner lists the senders: Microsoft 365, the quoting tool, the newsletter service.
- They find the one existing record at the registrar. It lists only the host.
- They edit that record, not add a new one, so it now has the Microsoft include, the quoting tool’s include and the newsletter service’s include. They keep the host’s include because the website form sends through it.
- The record ends in
~allfor the first few weeks. - They send test messages from each system to a webmail account and check the headers for
spf=pass. - Once every test passes, they change the ending to
-all.
Nothing here is complicated. It just needs the sender list done properly before the line is written.
Our view on SPF for small businesses
We see SPF as a small job that is easy to get wrong in one specific way: it is written for how you hoped to send email, not for how you actually do.
The record is one line. The work is the inventory behind it, and that is where having one person to contact helps: the same person who looks after your mailboxes and domain can see the website form, the invoicing tool and the DNS in one go, and agree the scope with you before work begins.
Our advice is to publish one complete record, test each sender, add DKIM and then move DMARC from monitoring towards enforcement at a pace your business can manage. Support is remote, with on-site work where agreed.
hostme.ie
If you would rather hand it over
hostme.ie provides business email and domain support for Irish sole traders and small businesses, especially in County Galway and County Mayo. If you would rather not edit DNS yourself, we can look at your sender list, your records and your domain setup, with the scope agreed before work begins. See business email on your own domain for how we work, or message hostme.ie on WhatsApp to talk it through. Phone and email are there too if you prefer them.
FAQ
Can I have more than one SPF record?
No. A domain should have a single SPF record, and having two makes SPF checks fail. If you add another sender, put its include into the existing record before the ending.
Where do I add an SPF record for Office 365?
At your domain registrar or DNS host, as a TXT record. Microsoft 365 has no admin centre setting for SPF. For Microsoft 365 only, the value is v=spf1 include:spf.protection.outlook.com -all.
Do I need SPF if I already have DKIM?
Yes, set up both. They check different things: SPF checks which server sent the message, DKIM checks the signature on it. Microsoft’s guidance treats them, with DMARC, as layers that work together.
How long does an SPF change take to work?
It depends on the TTL you set and on caching by other servers. Microsoft recommends a TTL of at least one hour for SPF records, so allow some time, then test with a message to an outside address.
Does an SPF record stop all spam and spoofing?
No. It helps receivers recognise mail that really comes from your domain and makes it harder to pass off forged messages as yours, but it is one part of email authentication, alongside DKIM and DMARC.
Sources
- Set up SPF to identify valid email sources, Microsoft Learn
- Connect your DNS records at Cloudflare to Microsoft 365, Microsoft Learn
- Set up SPF, Google Workspace Help






