What does an SPF record look like?
An SPF record is a single TXT record that starts with v=spf1. The rest is a list of terms, read left to right. The standard's own example allows the servers in the domain's MX records and the addresses around one named host, then fails everything else [1].
example.com. TXT "v=spf1 +mx a:colo.example.com/28 -all"
Here mx allows the servers named in your MX record, a: allows a host's address, and -all says every other sender fails [1]. Most small businesses use an include: term instead, which pulls in the list of the service that sends their mail.
A shop that sends from two places
Say example.com sends staff email through one provider and order confirmations through an online shop platform. The record could read: v=spf1 include:_spf.mailprovider.example include:_spf.shopplatform.example ~all. Each provider publishes its own include value, so copy it from their setup page, not from this example.
Why does my SPF record fail with too many lookups?
The standard caps the number of terms that cause a DNS query at 10. These terms are include, a, mx, ptr, exists and the redirect modifier. Go over 10 and the check returns a permanent error (permerror), which means the record could not be correctly interpreted [1]. The terms ip4, ip6 and all do not count [1].
Each include for a different mail service adds at least one lookup, and that service's own record can add more. A business that adds a newsletter tool, a CRM and a shop platform can pass 10 without noticing.
- Remove services you no longer use.
- Swap an
aormxterm for fixedip4addresses where the address will not change. - Never publish two SPF records on one domain. More than one record also produces a permanent error [1]. Merge them into one.
What is the difference between -all and ~all?
The all term goes last and catches every sender not matched earlier. A minus sign before it makes those senders fail [1]. A tilde makes the result a soft fail. The standard puts a soft fail somewhere between fail and neutral: the domain is not willing to make a strong policy statement, and receivers should not reject the message on that result alone [1]. A cautious way to start is ~all while you find every service that sends for you, then move to -all.
Do I need SPF to send email to Gmail and Yahoo?
You need SPF or DKIM at a minimum. Google asks every sender to set up SPF or DKIM for the sending domain [2]. Senders of more than 5,000 messages a day to Gmail accounts must set up SPF, DKIM and DMARC [2]. Yahoo asks all senders for SPF or DKIM at a minimum, and bulk senders must implement both SPF and DKIM and publish a DMARC policy [3].
| Sender type | What is asked | Source |
|---|---|---|
| Any sender to Gmail | SPF or DKIM at a minimum | Google [2] |
| More than 5,000 a day to Gmail | SPF, DKIM and DMARC | Google [2] |
| Any sender to Yahoo | SPF or DKIM at a minimum | Yahoo [3] |
| Bulk sender to Yahoo | SPF and DKIM, plus DMARC | Yahoo [3] |
SPF alone does not stop someone faking your visible From address. That is the job of DMARC, which asks that the domain that passed SPF or DKIM is the same as the domain in the From header [2].
Questions people ask
Is an SPF record the same as a TXT record?
An SPF record is stored as a TXT record. The TXT is the DNS record type, and the text inside it starts with v=spf1, which is what marks it as SPF [1]. A domain can have other TXT records beside it.
How many SPF records can a domain have?
One. If a receiver finds more than one SPF record on a domain, the check returns a permanent error [1]. Merge extra records into a single line with all your include terms.
Does SPF stop spam sent in my name?
Only partly. SPF checks the sending server against your list, but it does not by itself protect the From address people see. Google asks bulk senders to add DKIM and DMARC as well [2].
Pages that link here
A record, DKIM, DMARC, DNS, Email deliverability, Google Workspace, MX record, Open rate, Phishing, SMTP
See also
- DKIM DKIM is an email check where your mail server signs each message and publishes a public key in DNS, so the receiver can confirm the signature.
- DMARC DMARC is a DNS record that tells mail servers what to do with email that fails your SPF and DKIM checks, and asks them to send you reports.
- DNS DNS is the internet's address book: it turns a domain name like example.com into the number a computer needs to find your website or mail server.
- MX record An MX record is a DNS entry that names the mail server that receives email sent to your domain.
- Email deliverability Email deliverability is whether the email you send actually reaches the recipient's inbox instead of being blocked or sent to spam.
References
- RFC 7208: Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1, IETF. Read 27/11/2026.
SPF implementations MUST limit the total number of those terms to 10 during SPF evaluation, to avoid unreasonable load on the DNS.
- Email sender guidelines, Google Workspace Admin Help. Read 27/11/2026.
Set up SPF or DKIM email authentication for your sending domains.
- Sender best practices, Yahoo Sender Hub. Read 27/11/2026.
Implement SPF or DKIM at a minimum