What is an SPF record?
By Ash, Founder, HosteazePublished 1 min read
The short answer
An SPF record is a TXT record on your domain that lists which mail servers are allowed to send email using your domain name. Receiving servers check it to spot forgeries. Each domain can have only one SPF record, and it must stay within 10 DNS lookups or it stops working.

SPF stands for Sender Policy Framework. Think of it as the guest list for your domain's email: when a message arrives claiming to be from you, the receiving server checks whether the server that sent it is on the list. It works alongside DKIM and DMARC.
What does an SPF record look like?
v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all| Part | Meaning |
|---|---|
v=spf1 | Identifies the record as SPF. Must come first. |
include: | Adds another service's list of servers, such as Google Workspace or Microsoft 365. |
ip4: / ip6: | Allows a specific IP address or range, for example a server you run yourself. |
a / mx | Allows the servers your domain's A or MX records point to. |
~all | Anything not listed is a "soft fail": treat it as suspicious. |
-all | Anything not listed fails outright. |
Real records usually only need one or two include: terms. The example above covers a business that uses both Google and Microsoft, which is rarer than you'd think.
What goes wrong with SPF?
Three mistakes cause most SPF problems:
- Two SPF records. Adding a new service by creating a second
v=spf1record breaks SPF completely. Edit the one you have instead. - Too many lookups. Every
include:,a,mx,ptr,existsandredirectcosts a DNS lookup, and the limit is 10. Go over it and SPF returns an error. See how to fix "too many DNS lookups". - Forgotten senders. Your website's contact form or invoicing software sends as you too. If it isn't listed, its emails fail.
Is SPF enough on its own?
No. SPF checks the hidden "envelope" sender, not the From address people see, and it breaks when email is forwarded. That's why it's paired with DKIM and DMARC. For the full setup in the right order, see how to set up SPF, DKIM and DMARC.
Frequently asked questions
Where do I add an SPF record?
In the DNS settings for your domain, wherever your nameservers point. It's a TXT record on the root of the domain, usually entered with the host set to @.
Can I have two SPF records?
No. Two records starting with v=spf1 make SPF fail for every email. Combine every service into one record with several include terms.
Should my SPF record end in ~all or -all?
Either works once DMARC is in place. ~all marks unlisted senders as suspicious and -all says they fail outright. Many providers suggest ~all while you are still finding every service that sends as you.



