Check a domain

How it works

how receivers evaluate SPF
1. LOOKUPTXT record on the sending domainFOUND
2. MATCHis the sending IP in the authorised set?MATCH
3. POLICY-all → hard fail for everything elseSTRICT
4. ALIGNdoes it match the From: domain?ALIGNED
RESULTSPF contributes a DMARC passPASS
A pass at step 2 is not enough on its own — step 4 is what DMARC actually cares about.
01

Publish one record

Exactly one TXT record starting v=spf1. Two records is an instant permerror and SPF fails completely.

02

List your senders

Use include: for services that send on your behalf and ip4: for servers you control.

03

End with -all

Hard fail tells receivers to reject anything not on the list. ~all is the safe intermediate.

04

Watch the lookup count

Ten DNS lookups is the hard cap. Past it, receivers return permerror and SPF fails.

What SPF actually does

SPF is a published list of who is allowed to send mail using your domain. A receiving server takes the IP address the mail arrived from, looks up your SPF record, and checks whether that IP is on the list. That is the whole mechanism.

What trips people up is that passing SPF is not the same as passing DMARC. SPF validates the envelope sender — the hidden Return-Path address — not the From: address your recipient actually sees. DMARC requires those two to align. This is why mail sent through a third party can pass SPF perfectly while still failing DMARC, and why a checker that only tells you "SPF valid" is not telling you enough.

The faults that matter

Two SPF records. The most damaging and the easiest to cause — someone adds a second record for a new tool instead of merging an include into the existing one. The result is not "mostly working". Receivers return permerror and SPF fails outright for every message.

Ending in +all. This authorises the entire internet to send as your domain. It appears more often than you would expect, usually copied from a forum post by someone trying to stop mail being rejected.

Over ten DNS lookups. Every include: costs a lookup, and includes nest. Big vendors bring three or four each. Cross the limit and SPF fails everywhere. The SPF lookup counter expands the whole chain and tells you which mechanism tips you over.

Stale includes. Vendors you stopped using years ago are still authorised to send as you, and they are still consuming lookups. Every audit should start by removing them.

How to check an SPF record manually

SPF is a TXT record on the root domain itself, not on a subdomain — this is the opposite of DMARC and DKIM, which is why people query the wrong host for one of the three. Look it up directly:

  • macOS or Linuxdig +short TXT example.com
  • Windowsnslookup -type=TXT example.com
  • No terminal — paste the domain into the box above.

The root domain usually returns several TXT records — verification tokens, DMARC-unrelated vendor strings, site ownership proofs. The SPF record is the one beginning v=spf1, and there must be exactly one of them.

What an SPF record is made of

MechanismWhat it authorisesDNS lookups
v=spf1Version. Must be the first thing in the record.0
ip4: / ip6:Literal addresses or CIDR ranges. The cheapest way to authorise a sender.0
aThe domain's own A record — the web server, usually.1
mxWhatever your MX hosts resolve to. Costs more than one lookup if you have several.1+
include:Imports another domain's entire SPF record. This is how vendors are added, and how the lookup budget gets spent.1 each, nested
redirect=Replaces this record with another domain's entirely. Rare outside large organisations.1
exp=A text explanation returned on failure. Cosmetic.1 on fail
ptrDeprecated and slow. Never add it; remove it if you find it.many
allThe catch-all for everything not matched above. Must be the last term in the record.0

Only the first ten lookup-consuming mechanisms are evaluated. Everything past the tenth is not a warning — it turns the whole record into a permanent error. The SPF lookup counter expands every nested include and shows exactly which one tips the record over.

SPF result codes, and what receivers do with them

ResultCauseWhat it means for delivery
passThe sending IP is authorised by the record.Accepted, and available to satisfy DMARC if it aligns.
failNot authorised, record ends in -all.Receivers may reject outright. The strictest setting.
softfailNot authorised, record ends in ~all.Accepted but marked suspicious. The practical default for most domains.
neutralRecord ends in ?all.You have explicitly asserted nothing. Functionally the same as no protection.
noneNo SPF record published at all.No assertion, and increasingly read as an unmaintained domain.
permerrorBroken record — two SPF records, a syntax error, or more than ten DNS lookups.SPF fails for every message, everywhere. This is the one to fix today.
temperrorA DNS query failed transiently while evaluating.Usually resolves itself. Persistent temperror means a nameserver problem.

Why SPF breaks on forwarding

SPF checks the IP the message arrived from. When a message is forwarded — a prospect sends it to a colleague, a mailing list redistributes it, a corporate gateway relays it — the message arrives from the forwarder's server, which is not on your list. SPF fails, correctly and unavoidably.

Nothing in an SPF record fixes this, which is precisely why DKIM exists. A DKIM signature travels with the message and survives being passed along, so DMARC still passes on an aligned DKIM signature after SPF has broken. Any domain relying on SPF alone loses authentication at the exact moment its mail starts spreading inside an organisation. Confirm signing with the DKIM checker.

Frequently asked questions

What is the difference between ~all and -all?

Both mean "nothing else is authorised". The difference is the instruction to the receiver: ~all is a soft fail, which typically means accept but mark suspicious, while -all is a hard fail asking the receiver to reject. Once DMARC is enforcing, the practical gap narrows considerably, because DMARC policy takes over. Start at ~all while you verify nothing legitimate is missing, then move to -all.

Can I have separate SPF records for subdomains?

Yes, and you should. Subdomains do not inherit the parent domain's SPF record. If you send from mail.example.com it needs its own SPF record. A subdomain with no SPF record has no SPF protection at all.

My SPF passes but DMARC still fails. Why?

Almost always alignment. SPF authenticates the Return-Path domain, but DMARC requires that domain to match the visible From: domain. Third-party senders often use their own bounce domain, which passes SPF while failing alignment. DKIM usually solves this, because DKIM alignment is easier to satisfy — check yours with the DKIM checker.

Should cold email domains use the same SPF as my main domain?

No. Each sending domain gets its own SPF record listing only the provider that actually sends from it. Copying your main domain's record onto sending domains drags in includes for tools those domains never use, wastes lookups, and widens your authorised sender set for no benefit.

How do I check my SPF record?

Paste the domain into the box above, or query it directly with dig +short TXT example.com on macOS and Linux, or nslookup -type=TXT example.com on Windows. SPF sits on the root domain, so unlike DMARC there is no _dmarc-style subdomain to remember. Among the TXT records returned, the SPF record is the one starting v=spf1.

What does an SPF record look like?

Something like v=spf1 include:_spf.google.com ~all. It always opens with v=spf1, lists mechanisms authorising senders in the middle, and closes with an all term that decides what happens to everything else. Length is not a quality signal — a short record with one include is usually healthier than a long one carrying vendors nobody uses any more.

Can I have two SPF records on one domain?

No, and this is the single most damaging SPF mistake. Two TXT records starting v=spf1 produce a permerror, and SPF fails for every message rather than falling back to either record. It happens when someone adds a record for a new tool instead of merging its include into the existing one. The fix is to combine all includes into a single record and delete the extra.

What causes an SPF permerror?

Three things, in order of frequency: two SPF records on the same domain, more than ten DNS-lookup-consuming mechanisms, or a syntax error such as a missing colon, a stray space, or smart quotes pasted from a document. All three produce the same outcome — SPF fails everywhere until corrected. The lookup counter diagnoses the ten-lookup case specifically.

What is the too many DNS lookups error?

SPF permits a maximum of ten mechanisms that require DNS resolution during evaluation — each include:, a, mx and redirect= counts, and includes nest so a single vendor can consume three or four. Past ten, the record returns permerror. Remove vendors you no longer use first; that alone usually resolves it without any restructuring.

What is SPF flattening and should I use it?

Flattening replaces include: statements with the literal IP ranges they currently resolve to, eliminating lookups. It works, but it makes your record a snapshot — when a vendor changes their sending infrastructure, your record silently stops authorising them and mail starts failing. If you flatten, it needs automated monitoring. Pruning unused includes is almost always the better first move.

Does SPF need to be set up on subdomains?

Only on subdomains that actually send mail, and each one needs its own record — SPF is not inherited from the parent domain. A subdomain with no SPF record returns none rather than falling back to the root. Worth noting the reverse case too: a non-sending subdomain can be locked down with v=spf1 -all.

Why does SPF pass but DMARC still fail?

Because SPF is checked against the Return-Path address, which recipients never see, while DMARC is checked against the visible From address. When a sending platform uses its own Return-Path domain, SPF passes for that domain and DMARC still fails, since neither passing domain matches yours. Either publish DKIM under your domain or configure a custom Return-Path — one aligned pass is enough. Check the policy side with the DMARC checker.

How long does an SPF change take to apply?

As long as the TTL on the TXT record — typically five minutes to an hour — plus however long resolvers hold the old answer. Lower the TTL before making changes if you expect to iterate. If a change appears not to have taken, re-check from a second resolver before assuming the edit failed.

Can I check SPF for multiple domains at once?

Yes — enter one domain per line and each is looked up and evaluated separately. Email addresses work too, with the domain extracted automatically. Across a sending fleet this is how you find the domains still carrying an include for a tool you stopped using, or the one that quietly ended up with two records.

Last reviewed

Related tools

What to run next

The checks that most often follow this one.

Auth checkers

More in this category

Read more

Guides that go deeper

Services

When the tools tell you something is wrong

The diagnostics here are free and always will be. When the fix is bigger than a DNS record, this is the work I do.

Get in touch

Start with a call

Bring a domain and the symptom. I will tell you what is actually wrong and whether you need me at all — plenty of people leave that call able to fix it themselves.

Thirty minutes, no pitch

We will run the checks together on your actual domains, and you will leave knowing what is broken, what it takes to fix, and what it should cost. If that is a job you can do in-house, I will say so.

Based inRangpur, Bangladesh — all time zones
RepliesWithin one business day
LicensingWorkspace below list price
Back to top