SPF flattener and lookup fixer
Get an SPF record under the limit of 10 DNS lookups, with the safest fixes first and the new records ready to publish.
Results for fast.github.com
SPF lookups
fast.github.com has no SPF record, so there is nothing to optimize.
Publish one first.
Structured result (JSON) · 635 B
{
"domain": "fast.github.com",
"source": "published",
"permalink": "/spf-flattener?domain=fast.github.com",
"state": "no-record",
"before": {
"record": "",
"bytes": 0,
"lookups": 0,
"limit": 10,
"exceeded": false,
"voidLookups": 0
},
"costTable": [],
"suggestions": [],
"plan": {
"choose": [],
"lookupsAfter": 0,
"records": []
},
"noSafeFix": false,
"issues": [
{
"code": "NO_SPF",
"severity": "info",
"message": "fast.github.com publishes no SPF record, so there is nothing to optimize.",
"fix": "Publish one first."
}
],
"warnings": []
}More in Email · Build and fix
Next step
- SPF checkerCheck the new record once it is liveCheck fast.github.com in SPF checker
- SPF generatorStart again from your list of sendersOpen in SPF generator
- Email health checkThe whole mail setup in one reportCheck fast.github.com in Email health check
The 10 lookup limit, and what counts
SPF lets a receiver make at most 10 DNS lookups while it checks one message. Every include, a, mx, ptr, exists and redirect costs one, and so does every one of those inside an include. Plain ip4 and ip6 addresses cost nothing. Go over the limit and the record returns a permanent error (RFC 7208), so receivers may treat your mail as unauthenticated.
The limit is easy to reach. A company that uses Google Workspace, a marketing tool, a help desk and a billing service can hit it with four includes, because each provider's own record has includes inside. The checker follows the whole tree and shows what each include costs, so you can see where the lookups go before you change anything.
How to fix a record
- Enter the domainWe read its published SPF record and every include under it. To try a change first, paste a
v=spf1record under "Try a record before you publish it" and we count that one instead. - Look at the budget barThe bar shows each include as a block against the limit of 10 and a tick at your target. The default target is 9, which leaves one spare so adding a sender later does not break the record.
- Follow the ladderThe fixes are in order, safest first. Tick or clear Apply on a step and the plan, the count and the records are rebuilt. Without JavaScript you see the recommended plan.
- Publish in orderPublish any new records first, then change the root record, then check it with the SPF checker.
The fixes, in the order we offer them
| Fix | What it does | Risk |
|---|---|---|
| Remove dead includes | Drops includes that no longer have an SPF record. More than 2 empty answers is an error of its own. | Safe |
| Drop repeats and ptr | Removes an include listed twice and the discouraged ptr term. | Safe |
| Replace mx with addresses | Swaps the mx term for the addresses of your mail servers. Saves one lookup. | You must confirm the addresses are fixed |
| Move senders to a subdomain | Gives marketing senders their own record on a subdomain such as news.example.com. | You must confirm, and check alignment there |
| Flatten includes | Copies a provider's addresses into your record, so it needs no lookup. | Goes stale when the provider changes |
The default plan applies the safe steps, then only as many of the others as it takes to reach your target. Flattening is never in the default plan. An include that uses a macro or exists depends on the sender and can never be copied, so those are marked and left alone, and any name you list under "Keep these includes as they are" is never flattened.
Why flattening is the last resort
A flattened record is a snapshot. When a provider adds or moves a sending address, your copy is wrong until you update it, and mail from the new address can fail SPF. The ladder marks flattening as going stale, shows how much bigger the record becomes, and offers it as a plan only when it fits in 6 records. An include we have never seen change is labelled "No history yet" and is never pre-selected.
If you flatten anyway, keep a reminder to recheck. A recheck link carries the names of the includes you flattened, and the page then compares their addresses today with what your records cover and lists any that are missing. For a record you have not published yet, the same page works as a calculator.
Other checks that go with SPF
- Start from your list of senders with the SPF record generator.
- Check DKIM, which carries mail that SPF cannot, with the DKIM checker.
- See whether your policy protects the domain with the DMARC checker.
- Run the bulk sender rules of Gmail and Yahoo with the sender requirements check.
Questions people ask
What happens when SPF needs more than 10 lookups?
The receiver stops and returns a permanent error. Many treat the message as if SPF had failed, and some reject it. The error is silent for the sender, so mail simply starts failing.
Should I always flatten my SPF record?
No. Flattening works but goes stale when providers change their addresses. Remove what is dead, move marketing senders to a subdomain and ask providers for a single include first. Flatten only what is left.
Why is my target 9 and not 10?
At exactly 10 lookups the next include you add breaks the record. A target of 9 leaves a spare. You can change it under More options.
Why can some includes not be flattened?
An include that uses a macro or exists is judged per message, from the sender address, so it has no fixed list of addresses to copy. The same goes for ptr and for names that did not answer.
Does the tool change my DNS?
No. It reads your records and writes the new ones as text for you to publish. Nothing is changed for you, and a record you paste is counted but never stored or put in the page address.
How big can a flattened record be?
One TXT string holds 255 characters, and a record is split into several strings that DNS joins. Large flattened lists are split across up to 6 records here. Above that, moving senders to a subdomain is the better route.
Use it from AI, the API or the command line
Every LookupOwl tool is also a free API and an MCP tool, with no key and no account. This one is spf_optimize. Please be kind to the rate limits.
curl "https://lookupowl.com/api/v1/tools/spf-optimize?q=github.com"claude mcp add --transport http lookupowl https://lookupowl.com/mcp