SPF Optimizer
Fix “too many DNS lookups” and SPF PermError with a cleaner, validated SPF record — without guessing which senders are still active.
- Counts your real DNS lookups Every include, redirect and nested lookup against SPF’s 10-lookup limit.
- Applies only safe cleanup Exact duplicates and terms that can never be reached. Your senders stay authorized.
-
Explains the rest Provider removal, flattening or
ptrreplacement is a recommendation you decide on.
Analyzing SPF structure…
Example: what the optimizer does
v=spf1 include:_spf.google.com include:sendgrid.net include:_spf.google.com ip4:203.0.113.10 ~all include:old-esp.example
v=spf1 include:_spf.google.com include:sendgrid.net ip4:203.0.113.10 ~all
- Duplicate
include:_spf.google.comremoved — it cost DNS lookups and added nothing. include:old-esp.exampleafter~allremoved — receivers never evaluate it.
For your real record, MXFend shows the lookup count before and after.
How it works
-
Enter your domain
MXFend fetches your SPF record and resolves every include and redirect, the same way a receiving mail server does.
-
See where your lookups go
Full lookup budget, PermError risk and what each term costs.
-
Copy the proposed record
Validated for syntax, lookup count, the
allqualifier and TXT string length — with step-by-step instructions to publish it at your DNS provider.
What it changes automatically — and what you decide
Applied automatically (safe)
- Exact duplicate terms
- Terms after
allthat are never evaluated
Shown as a recommendation (your decision)
- Removing a sender you no longer use
- Flattening an include into IP ranges
- Replacing the deprecated
ptrmechanism - Reviewing
existsmechanisms
MXFend never changes your DNS. You copy the record and publish it yourself.
When it won’t generate a record
The optimizer stops and explains why instead of producing an unsafe candidate when:
- no SPF record is published
- there are multiple SPF records — these must be merged by hand (see the guide below)
- a DNS lookup timed out
- includes form a loop
- the record has a structural PermError
Frequently asked questions
What is the SPF 10 DNS lookup limit?
SPF lets a receiving server perform at most 10 DNS-querying lookups — include, a, mx, ptr, exists and redirect, nested ones included. Above 10 the SPF check fails with PermError, so mail can fail SPF or land in spam.
Will the SPF Optimizer remove my email providers?
Not automatically. Removing a sender is always a recommendation you confirm, because only you know which services still send mail for your domain.
Does it flatten my SPF record?
No. Flattening replaces includes with IP addresses that providers can change without notice, so it is only offered as a review recommendation with the trade-offs explained.
Does MXFend change my DNS?
No. You copy the proposed record and publish it at your DNS provider yourself.
What if my record is still over 10 lookups after cleanup?
The review recommendations show which senders or includes could be removed or flattened and how many lookups each one would save, so you can decide what to change.
I have two SPF records. Can it fix that?
It detects the problem and explains it, but merging two records has to be done by hand — see the multiple SPF records guide.
Is the SPF Optimizer free? Do I need an account?
Yes, it is free, and no account is needed.