An SPF record is a line of text in your domain's DNS that lists the mail servers allowed to send email for your domain. When a message arrives claiming to be from you@yourbusiness.co.za, the receiving server looks up your SPF record and checks whether the sending server is on that list. If it is, the message passes; if it is not, the receiver treats it as suspicious or rejects it. This guide explains what a DNS SPF record looks like, how to read every part of it, how to set one up correctly and the mistakes that quietly send business email to spam.
SPF record in one sentence
SPF (Sender Policy Framework) is an email authentication standard, published as a DNS TXT record that starts with v=spf1, which tells receiving mail servers which IP addresses and services may send email using your domain name, and what to do with mail from anywhere else.
What is an SPF record and why does it exist?
Email was designed in an era when nobody checked who was sending what. Anyone can type any address into the "From" field, which is why scammers can send invoices that appear to come from your accounts department. Sender Policy Framework was created to close part of that gap. You publish a list of approved senders, and every receiving server that follows the standard (Gmail, Outlook and almost every business mail system do) checks new mail against it.
For a South African business the practical benefits are simple. Your quotes and invoices are more likely to land in the inbox, criminals have a harder time pretending to be you, and you meet the basic sender requirements that the large mailbox providers now enforce. Gmail and Yahoo both require senders to have SPF or DKIM in place, and bulk senders need SPF, DKIM and DMARC together. If your domain sits with our team, the SPF record lives alongside the rest of your DNS on the same account where you manage your business email hosting, so you can change both in one place.
How a DNS SPF record works, step by step
SPF works quietly in the background every time an email is delivered. The check happens in a fraction of a second, but it follows the same order every time:
- You send an email. Your mail server connects to the recipient's server and announces the envelope sender, also called the Return-Path, for example bounce@yourbusiness.co.za.
- The receiver reads the domain. It takes the domain from that envelope address and asks DNS for its TXT records.
- It finds the SPF record. Among the TXT records it looks for the one that starts with v=spf1. There must be exactly one.
- It compares the sending IP. The receiver works through the mechanisms from left to right (ip4, include, mx and so on) until one matches the IP address that connected to it.
- It returns a result. The matching mechanism decides the outcome: pass, fail, softfail or neutral. If nothing matches, the final all mechanism decides.
- The receiver acts on it. A pass helps the message reach the inbox. A fail can lead to rejection or the spam folder, especially when your DMARC policy says so.
Because SPF lives in DNS, it is published wherever your domain's nameservers point. If you are unsure where that is, our guide on how DNS works for .co.za domains explains nameservers and zones in plain language.
SPF record syntax: reading every part
An SPF record looks cryptic at first, but it is just a short list of rules separated by spaces. Here is a typical record for a business that sends mail from its hosting server and from a newsletter service:
v=spf1 a mx ip4:203.0.113.10 include:_spf.example-mailer.com ~all
Read from left to right, it says: this is SPF version 1; allow the server in my A record; allow my MX servers; allow the single IP 203.0.113.10; allow whatever the mailing service lists in its own SPF record; treat everything else as a soft fail.
| Part | What it means | Example |
|---|---|---|
| v=spf1 | Version tag. Must be first, or the record is ignored. | v=spf1 |
| ip4 / ip6 | Authorises a specific IPv4 or IPv6 address or range. | ip4:203.0.113.0/24 |
| a | Authorises the IP addresses in the domain's A record. | a or a:mail.yourbusiness.co.za |
| mx | Authorises the servers listed in the domain's MX records. | mx |
| include | Pulls in another domain's SPF list, used for email platforms and sending services. | include:_spf.google.com |
| all | Catch all at the end. Decides what happens to every sender not listed. | ~all or -all |
| redirect | Modifier that hands the whole policy to another domain's record. | redirect=_spf.yourgroup.co.za |
SPF record qualifiers: +, -, ~ and ?
Each mechanism can carry a qualifier that sets the result when it matches. Plus (pass) is the default and is usually left out. The one that matters most is the qualifier on all at the end of the record.
- -all (hard fail): anything not listed should be rejected. The strictest option, best once you are sure every sender is listed.
- ~all (soft fail): anything not listed is suspicious, so accept but mark it. The safest choice while you are still testing.
- ?all (neutral): no opinion. Gives almost no protection.
- +all (pass everything): allows the whole internet to send as you. Never use it.
SPF record examples for common setups
Most small businesses fit one of the patterns below. Swap in your own IP addresses and use the exact include value that your email provider publishes in its help pages, because these change from time to time.
| Your setup | Example SPF record |
|---|---|
| Email hosted on the same server as your website | v=spf1 a mx ~all |
| Hosting server plus a dedicated outgoing IP | v=spf1 a mx ip4:203.0.113.10 ~all |
| Google Workspace mailboxes | v=spf1 include:_spf.google.com ~all |
| Microsoft 365 mailboxes | v=spf1 include:spf.protection.outlook.com -all |
| Hosted mailboxes plus a newsletter platform | v=spf1 mx include:(your newsletter provider's value) ~all |
| Domain that never sends email (parked) | v=spf1 -all |
The last row is often forgotten. If you own extra domains that only redirect to your main website, such as a .com that points to your .co.za domain, publish v=spf1 -all on them so nobody can use them for spoofing.
How to set up an SPF record for your domain
You do not need to be technical to add or fix SPF. You need access to wherever your DNS is managed and a list of every service that sends email for you.
- List every sender. Think beyond your mailbox: website contact forms, your accounting system, online store order emails, newsletter tools, CRM and helpdesk platforms all send mail using your domain.
- Find where your DNS lives. If your domain uses our nameservers, it is in the DNS settings in Plesk or your client area. If it points elsewhere, edit it there instead.
- Check for an existing record. Search the TXT records for one starting with v=spf1. Edit it rather than adding a second one.
- Build one record. Start with v=spf1, add a, mx, ip4 or include entries for each sender, then end with ~all.
- Save and wait. DNS changes usually show within an hour, but can take up to a day or two to update everywhere. Our guide to DNS propagation explains why.
- Test, then tighten. Send test mail to a Gmail address, open "Show original" and look for SPF: PASS. After a few weeks with no unexpected failures, you can move from ~all to -all.
Tip for Plesk users: when DNS is managed on the hosting server, Plesk adds a default SPF record for you. It covers the server itself, so you only need to edit it when you add an outside service such as a newsletter platform or a separate mailbox provider.
How to check an SPF record
Checking takes two minutes and is worth doing whenever email starts bouncing. "Check spf record" is the most searched SPF task for good reason: most problems are visible straight away.
- Online lookup tools. Free SPF checkers show your record, count DNS lookups and flag syntax errors.
- Command line. On Windows run
nslookup -type=txt yourbusiness.co.za; on Mac or Linux rundig txt yourbusiness.co.za. - Message headers. In Gmail, open a message you sent and choose "Show original". The SPF line shows pass, softfail or fail and the IP that was checked.
SPF record mistakes that send email to spam
Most SPF problems we fix for clients come down to the same handful of errors. Each one can stop invoices and quotes from being delivered without anyone noticing for weeks.
| Mistake | What happens | Fix |
|---|---|---|
| Two SPF records on one domain | Receivers return a permanent error and SPF fails for everything. | Merge all senders into a single v=spf1 record. |
| More than 10 DNS lookups | The record hits the lookup limit and fails with a permerror. | Remove unused includes, swap includes for ip4 ranges where providers allow it. |
| A sender left out | Contact form or invoice mail fails SPF and lands in spam. | Add the missing service with its include or IP. |
| Using +all | Anyone can pass SPF as your domain. | Change to ~all, then -all once tested. |
| Typos in the include value | The lookup fails and so does the record. | Copy the value exactly from your provider's documentation. |
| Old provider still listed after a move | Wasted lookups and a wider attack surface. | Remove services you no longer use. |
If your messages still go to junk with a valid record, SPF is rarely the only cause. Our article on why business emails go to spam covers content, reputation and the other checks receivers run.
SPF, DKIM and DMARC: how they work together
SPF is one of three records that prove an email is genuine, and it has a known weak spot: it checks the hidden envelope sender, not the "From" address people see. A scammer can pass SPF on their own domain while showing your name in the From line. That is why SPF should never stand alone.
DKIM
Adds a digital signature to each message using a key published in DNS. It proves the content was not changed in transit and survives forwarding, where SPF often breaks.
DMARC
Ties SPF and DKIM to the visible From address and tells receivers what to do when both fail: nothing, quarantine or reject. It also sends you reports on who is sending as your domain.
A sensible order for a small business is SPF first, then DKIM, then a DMARC record set to p=none so you can read the reports before you enforce anything. Your SPF entry is itself a TXT record, so our explainer on DNS TXT records is useful background if you manage other verification records too.
When you need to update your SPF record
An SPF record is not set and forget. Review it whenever your email setup changes, especially:
- When you move email or hosting to a new provider.
- When you start using a newsletter, CRM, booking or invoicing tool that emails customers for you.
- When you register a new domain for a brand, campaign or project.
- When customers tell you your mail is landing in their spam folder.
Registering a new name with us through our domain name search gives you DNS management on the same account, so you can add an SPF record on day one rather than after the first bounced invoice. If you would rather have our team check your current records, send us your domain through the contact page and we will tell you what needs fixing.



