SPF softfail vs hardfail: which to use, and why +all is never okay
Use -all (hardfail) or ~all (softfail) at the end of your SPF record, and never +all. If you are not sure you have listed every service that sends your email, start with ~all, then move to -all once you are confident.
Your SPF record is a short line of text in your domain's DNS that lists which servers may send email as your domain. The last part of that line, the "all" at the end, tells receiving mail servers what to do with everything not on the list. Many domains end with the wrong one, and the most serious mistake is +all, which says that anyone in the world may send as you.
What the endings mean
The symbol in front of all sets the instruction:
| Ending | Name | What it tells receivers |
|---|---|---|
-all | Hardfail | Mail from anyone not listed is not authorized |
~all | Softfail | Mail from anyone not listed is probably not authorized, treat with suspicion |
?all | Neutral | No opinion either way |
+all | Pass all | Everyone is authorized, including spammers |
A record with +all is effectively no protection at all. A record with ?all is not much better. Both ~all and -all are real protection, and the difference between them is smaller than most people think.
What people see
Often nothing, which is why this problem lasts for years. Email keeps flowing. You may notice some symptoms:
- Customers report getting scam emails that appear to come from your address.
- Your own emails land in spam more often than they should (see emails going to spam).
- A mail checker tool shows a warning about your SPF record.
Softfail vs hardfail: which to use
The practical answer has three parts.
- Never use `+all`. There is no good reason for it. It usually appears because someone copied a record from a forum or a setup wizard added it while trying to "make email work".
- `-all` is the stricter, clearer choice and is the better end goal. It states plainly that unlisted senders are not allowed.
- `~all` is a reasonable, safer starting point when you are unsure about every service that sends mail for you (invoicing tools, newsletter apps, a CRM, a booking system). If you forget one and use
-all, its emails may be rejected. With~allthey are more likely to be accepted but marked suspicious.
In practice, many receivers treat the two similarly, especially when you also have a DMARC record. That is one reason many guides say ~all plus a working DMARC policy is fine. Providers differ in their advice, so follow what your mail provider documents if it states a preference. Email forwarding can also break SPF (the forwarding server is not on your list), which is another reason some people stay on ~all.
A sensible path: start at ~all, set up DMARC with reports, watch for a few weeks to see who is really sending as you, then move to -all.
How to check your record (free)
You only need your domain name.
- Use a free online SPF checker (MXToolbox has a well-known one) and enter your domain.
- Or in a terminal, run
nslookup -type=TXT yourdomain.com(Windows) ordig TXT yourdomain.com(Mac and Linux). - Find the line that starts with
v=spf1. Look at how it ends.
A typical healthy record looks like this:
v=spf1 include:_spf.google.com include:mailer.example.net -all
While you are there, check there is only one v=spf1 line. Two records cause failures of their own, see multiple SPF records.
How to fix it
- List every service that sends email as your domain. Think about your main mailbox provider, your website's contact forms and shop emails, newsletter tools, invoicing and CRM software. Ask your developer if unsure.
- Find each service's SPF instructions. Each gives you an
include:value to add. - Log in to wherever your DNS is managed. This is your domain registrar, your host, or a service like Cloudflare. If you are not sure, look up your nameservers.
- Edit the existing TXT record that starts with `v=spf1`. Do not add a second one. Add the
include:values and change the ending to~allor-all. - Save. DNS changes can take from a few minutes to a few hours to show everywhere.
The record can only hold ten DNS lookups in total (each include: usually counts, and some count several). Going over the limit makes SPF fail, so do not stack up services you no longer use. Remove old ones.
Where the setting lives depends on your provider. Most use a DNS or "Manage DNS" page with a list of TXT records. We have a step by step guide for Google Workspace, and the same idea applies on Microsoft 365, Cloudflare, GoDaddy, Namecheap, cPanel and SiteGround: find the TXT record for the root of your domain (shown as @ or blank) and edit it.
How to confirm it worked
- Run the same SPF checker again after an hour or so. It should show one record ending in your chosen
~allor-all, with no errors about lookups. - Send a test email from every service you listed, to a Gmail address. In Gmail, open the message, choose "Show original", and look for
SPF: PASS. - Watch for bounce messages from any service you forgot. If a tool's emails start failing after you moved to
-all, add itsinclude:value.
Why it matters
An open or weak SPF record makes it easier for criminals to send fake invoices or password requests in your name, which hurts customer trust. It also feeds into how mailbox providers judge your domain, and the big providers expect proper authentication from senders (see Gmail and Yahoo bulk sender requirements). SPF works best alongside DKIM and DMARC. If you have not set up DMARC yet, see missing DMARC record.
How to stop it coming back
- Keep a short written list of the services that send email for your domain.
- Whenever you add or drop a tool that sends email, update the SPF record the same day.
- Always edit the existing record. Never paste a second
v=spf1line. - Re-check your record every few months, and after any change of host or website agency.
SiteMonday checks this in week 10 (domain, SSL and email deliverability) and lists it in a ranked fix list. It finds and explains the problem. Making the change is up to you or your developer.
Step by step for your platform
- SPF ending in +all or ~all on Google Workspace
- SPF ending in +all or ~all on Microsoft 365
- SPF ending in +all or ~all on Cloudflare
- SPF ending in +all or ~all on GoDaddy
- SPF ending in +all or ~all on Namecheap
- SPF ending in +all or ~all on cPanel
- SPF ending in +all or ~all on SiteGround
Questions
Is ~all or -all better for SPF?
`-all` is stricter and is the better long term target, while `~all` is safer if you are not sure you have listed every sender. Both are far better than `+all`.
Is +all ever correct?
No. It tells receivers that every server on the internet may send email as your domain, which defeats the purpose of SPF.
Will -all make my emails bounce?
Only email from services you did not list in your SPF record, and only if the receiver acts on the result. Test every sending service before switching.
Do I need DMARC if I have SPF?
You should have both. SPF only checks the sending server, while DMARC tells receivers what to do with failures and can send you reports.
Can I have two SPF records if I use two email services?
No. Combine them into one record with several `include:` values. Two `v=spf1` records cause SPF to fail.
How long until my SPF change takes effect?
Often within minutes, but it can take a few hours depending on the record's TTL setting. Re-check with an SPF tester after about an hour.