SPF Record Syntax: Mechanisms, Qualifiers, Modifiers and Common Errors
An SPF record is one DNS TXT record at your domain that starts with v=spf1, followed by mechanisms that say which servers may send mail for the domain, each with an optional qualifier, and optionally the modifiers redirect= and exp=, once each. Spaces separate the terms:
v=spf1 include:_spf.google.com ip4:192.0.2.10 -all
The syntax is strict. A receiver checks the whole record before it evaluates any of it, and a syntax error anywhere returns permerror for every sender, including the ones listed correctly (RFC 7208 §4.6). In our October 2026 scan of the Tranco top 100,000, 355 of the 71,117 domains with SPF had such an error, nearly half of them a misspelled mechanism name or a misplaced space. Some typos are quieter: include= instead of include: isn't an error at all, receivers just skip the term, so it no longer authorizes the sender it was meant for.
TL;DR
- Format:
v=spf1, then mechanisms (include,a,mx,ip4,ip6,exists,all, and the deprecatedptr), then modifiers, separated by spaces. One record per name. - Order matters for evaluation, not for syntax. Receivers test mechanisms left to right and stop at the first match. Nothing after
allis evaluated, but it's still syntax-checked. - Two kinds of typo. A wrong mechanism name (
ipv4:,includes:) breaks the whole record. A colon written as=(ip4=,include=) turns the term into an unknown modifier that receivers ignore, so only that term stops working. - Receivers don't all follow the standard. In our 21-provider test, Outlook.com passed a record with
ipv4:as if it saidip4:, and Google's DMARC reports called both syntax errorsfail, notpermerror.
An SPF record, term by term
Here's the example above, one term at a time:
A receiver checks the record of the domain in the envelope sender, the MAIL FROM address, which can differ from the From address people see. It may check the HELO name the same way, as a separate identity (§2.3, §2.4). It tests the mechanisms from left to right and stops at the first one that matches. The qualifier of that mechanism is the result (§4.6.2). If nothing matches and there's no redirect=, the result is neutral, as if the record ended in ?all (§4.7).
The record goes in a TXT record at the exact name it covers. A subdomain that sends mail needs its own record, and the dedicated "SPF" record type that some DNS panels still offer was discontinued in 2014: receivers only read TXT (§3.1).
SPF mechanisms
Without a domain, a, mx and ptr use the domain being checked. a and mx also take prefix lengths to cover the network around each address: a/24 sets the IPv4 prefix, a//64 the IPv6 one, a/24//64 both. exists: names are usually built with macros, such as %{i} for the sending IP.
The third column matters because a record may cause at most 10 DNS-querying terms per evaluation, nested includes counted, before the result becomes permerror (§4.6.4). It counts terms against that limit, not DNS queries: an mx or ptr term can send several queries and still counts once. ip4, ip6 and all are free. Here's how to count them and cut back.
include is the one people misread. It doesn't paste the other record into yours: it asks whether that record gives pass. A fail or softfail inside the included record just means "no match here", and evaluation moves on to your next term (§5.2). If the included domain has no SPF record at all, the result is permerror, so the name has to be exact.
These are the includes the top 100,000 use most, from our census:
The cost counts the include itself plus everything it pulls in, as published on the scan day, October 2026.
SPF qualifiers
A qualifier is the one character in front of a mechanism that sets the result when it matches:
Out of 70,338 domains with a single SPF record. Another 1,897 (2.7%) have no all term: 1,587 of them end in redirect=, and the other 310 leave a sender no mechanism matches at neutral.
Qualifiers work on any mechanism, but in practice they sit on all. +all authorizes every server on the internet, which makes the record pointless: 35 of the top 100,000 publish it. With DMARC, -all and ~all both deny the aligned SPF pass DMARC needs, so the difference is smaller than it looks. We compared the two here.
SPF modifiers: redirect= and exp=
Modifiers are name=value pairs. They don't match anything themselves.
redirect=<domain>applies only when no mechanism has matched. It hands the evaluation to another domain's record, and that record's result,failorsoftfailincluded, becomes yours (§6.1). It's ignored whenever the record has anallterm anywhere (§5.1), and it costs one lookup.exp=<domain>points to a TXT record with an explanation that a receiver may quote when it rejects a message forfail(§6.2). Few domains use it, and it doesn't count toward the 10 lookups.- Each may appear once. A second
redirect=orexp=is apermerror(§6). The standard asks for them at the end of the record, after the mechanisms, but that's a recommendation, not a syntax rule. - Any other syntactically valid
name=valueis an unknown modifier, and receivers must ignore it "no matter where, or how often" it appears (§6). That rule is whyinclude=doesn't break a record, and also why it does nothing. The value still has to be valid:foo=%is a syntax error.
redirect= vs include:
redirect= is for a group of your own domains that should share one record:
example.org. TXT "v=spf1 redirect=_spf.example.com" example.net. TXT "v=spf1 redirect=_spf.example.com" _spf.example.com. TXT "v=spf1 include:_spf.google.com ip4:192.0.2.10 -all"
Change _spf.example.com and all three domains follow. For a provider's servers, use include:. A redirect to a domain you don't control also hands over your policy, and the standard warns that the other domain's record may not work for your addresses (§6.1).
The common mistake is a redirect with an all next to it, such as v=spf1 redirect=_spf.example.com ~all. The ~all wins, the redirect never runs, and every sender gets softfail. Write either v=spf1 redirect=_spf.example.com or v=spf1 include:_spf.example.com ~all.
SPF record examples
The first two are what Google and Microsoft give in their setup guides, with each vendor's choice of ~all or -all. 192.0.2.10 stands for your own address.
A domain that sends no mail at all is worth a record too: v=spf1 -all tells receivers that any message from it is forged. In the census, 2,591 domains without MX records publish exactly that. Every additional sender, such as a newsletter platform or a help desk, adds its include to the one record. Adding a second v=spf1 record instead makes SPF fail for everyone; here's how to merge two records.
SPF format rules that catch people out
- It starts with exactly
v=spf1. Followed by a space or the end of the record (§4.5).v=spf10,v=spf2.0/pra(the retired Sender ID) and a record with a space in front ofv=spf1aren't SPF records, so the domain has none. So is one pasted from a word processor with curly quotes,“v=spf1 -all”: the quote mark becomes the record's first character. - Spaces separate terms, and nothing else does. Extra spaces are fine. A tab or a line break inside the record is a syntax error. A comma or a semicolon isn't a separator either:
ip4:192.0.2.10,ip4:192.0.2.11is an invalid address, andinclude:_spf.google.com,include:servers.mcsv.netis one long name that doesn't exist, so the lookup fails. - Case doesn't matter.
V=SPF1 IP4:192.0.2.10 -ALLis valid: mechanism and modifier names are case-insensitive (§4.6.1). - A domain name needs a dot.
a:mailis a syntax error. Write the full name,a:mail.example.com. An IP address isn't a domain name either:a:192.0.2.10is an error,ip4:192.0.2.10is right. - IP addresses are written in full.
ip4:takes four numbers and an optional prefix from/0to/32,ip6:takes an IPv6 address and up to/128.ip4:192.0.2is an error,ip4:192.0.2.0/24is the range you meant (§5.6). - Long records are split into strings, and the strings join without spaces. A TXT string holds at most 255 characters, so DNS panels split longer records, and receivers join the parts exactly as they are (§3.3). See the example below the list.
- Keep the whole answer small. The standard asks for SPF answers that fit in 512 bytes, which leaves roughly 450 for the name and all TXT records at it (§3.4). Larger answers can fail where DNS over TCP is blocked.
- Macros have their own syntax.
%{i},%{d}and the other macro letters let a record build names from the message, mostly inexists:. 2,844 single records in the census use them. A wrong letter, such as%{z}, is a syntax error.
In a split record, the space between two terms has to stay inside one of the strings:
"v=spf1 include:_spf.google.com " "include:servers.mcsv.net ~all"
Without that trailing space, the record reads include:_spf.google.cominclude:servers.mcsv.net. That's still valid syntax, so a check of the syntax alone passes it, but it's a lookup for a name that doesn't exist, and a permerror for every sender that reaches it.
A trailing dot after a domain name, as in include:spf.protection.outlook.com., is allowed by the standard (§7.1), and parsers accept it. Microsoft's setup guide still lists it as a mistake, so leaving it off costs nothing.
Common SPF syntax errors
These break the whole record. Every sender gets permerror, the correct terms included:
These are valid syntax, so receivers carry on, but the term does nothing:
A term after all is never evaluated, but it's still checked: v=spf1 -all ipv4:192.0.2.10 is a permerror, not a harmless leftover.
Microsoft's guide also lists include= as a syntax error. In our test, Outlook.com's aggregate report labeled our include= record permerror, while every other reporter labeled it fail, which is what the standard gives.
What the top 100,000 domains got wrong
We took the 355 records that failed the syntax check in our census and ran each one through the parser behind our SPF Checker. The table counts each domain once, by the first error the parser found. 98 of the records have more than one. The counts are on GitHub, and the numbers in the two paragraphs below the table are in a second file.
A wrong mechanism name is the most common error: 40 of the 87 records use ipv4:, the typo from our test below, and 20 shorten it to ip. Spaces cause 83 more. A space after the colon (ip4: 192.0.2.10, 40 records) leaves an empty mechanism followed by an address with no mechanism in front of it. A missing space runs two terms together: 17 records end in something like include:_spf.google.com~all.
Of the 47 records with another TXT value inside, 26 carry a Google site-verification token, and in 34 the pasted value follows all with no space. One way that happens is saving the SPF record and the token as two strings of the same TXT record, since strings are joined without a space (§3.3). Invisible characters are the hardest to spot in a DNS panel: 13 records contain a non-breaking space, and 11 a line break or a tab. Eight domains publish nothing but a, mx and an empty ip4: (v=spf1 a mx ip4: ~all), which looks like a template whose address was never filled in.
What receivers did with typos in our test
In our test of 21 mailbox providers, four of the records had typos: ip4= and ipv4: sent from our own server, include= and includes: sent through Mailgun. The domain had DMARC p=reject and the messages had no aligned DKIM signature, so SPF was all they had.
- The big receivers refused both include typos. Through Mailgun, Gmail, Yahoo, Apple and Outlook.com refused
include=andincludes:with DMARC replies, while the clean control was delivered. From our own server, Gmail refusedip4=andipv4:the same way. Yahoo and Apple refused those messages too, but their replies cited our sending IP and hit the clean control as well, so they say nothing about the typos. - Outlook.com passed
ipv4:. Its own DMARC report givesspf=passfor that record, and the mistyped term was the only one that could match our address. That is consistent with readingipv4:asip4:, although a report doesn't show the receiver's parser. It refusedincludes:with its usual550 5.7.509, so it isn't lenient about typos in general. - Reports name a syntax error four ways. For the
ipv4:record, Google reportedfail, Mail.runone, Seznampermerrorand Outlook.compass. Google also reportedincludes:asfail. If you look forpermerrorin your DMARC reports, you won't find a syntax error that Google saw. - A few receivers told the typos apart at SMTP. Interia refused the
include=record, which givesfail, and kept deferring theincludes:one as "SPF with invalid content".
A receiver that lets a broken record through today isn't a reason to keep it. The study has every receiver's result for each typo and the bounce text each one sends.
How to check your record's syntax
Paste the domain into the DMARKOFF SPF Checker. It reads the published record, checks every term against RFC 7208 and points at the character where the syntax breaks. For one of our test domains, whose record says includes:_spf.mailgun.org, it answers:
Checker output: Syntax error at character 8 in "includes:_spf.mailgun.org": unknown mechanism "includes" (did you mean include:_spf.mailgun.org?). The whole record is a permerror: receivers evaluate none of its terms
For include=, it reports a term receivers ignore rather than an error, because that's what the standard makes of it.

The SPF Checker on one of our test domains. One wrong letter in a mechanism name stops the whole record, so the -all below it is never evaluated either.
To read the raw record yourself:
dig +short TXT example.com
Each line of the answer is one TXT record:
"v=spf1 include:_spf.google.com " "include:servers.mcsv.net ~all" "google-site-verification=example-token"
Quoted strings on the same line are parts of one record and join without added spaces, so check where the spaces fall between them. The quotes only mark the strings; they aren't part of the record. Other lines are separate records: a verification token like the one above stays in its own record and never goes into SPF. After you fix the record, the old one can stay in resolvers' caches until its TTL, as set in your DNS panel, runs out. Recheck once that time has passed, then watch the next days of DMARC reports for the senders that failed.
FAQ
v=spf1, then the mechanisms that list your senders, then usually an all term, separated by spaces, in one TXT record at the domain. For example: v=spf1 include:_spf.google.com ip4:192.0.2.10 -all.
No. Mechanism and modifier names are case-insensitive, so V=SPF1 IP4:192.0.2.10 -ALL is as valid as the lowercase form.
Yes. List each sender as its own include: in the same record. The limit is 10 DNS-querying terms per evaluation, counting the includes a receiver reaches and the terms inside them, not a number of includes.
No. RFC 7208 recommends putting it last, but a record with redirect= elsewhere is still valid. What matters is that the record has no all term, or the redirect is ignored.
Not for the syntax. It matters for evaluation: receivers stop at the first match, so a sender listed before a broken include, or before an 11th term that needs a DNS lookup, still passes. An ip4: after ten such terms can still match, because it needs no lookup. A syntax error breaks the record wherever it is.
Each TXT string holds 255 characters, and a record can span several strings joined without spaces. The standard asks that the whole DNS answer stay under 512 bytes, and an evaluation use at most 10 DNS-querying terms.
Co-founder & CTO at DMARKOFF and GlockApps, email security specialist with 20+ years of experience, Golang & ClickHouse expert. A happy father of two teenagers.


