---
title: "SPF Checker with Lookup Tree and Lookup Count"
url: "https://coldagentai.com/tools/spf-checker.md"
canonical_url: "https://coldagentai.com/tools/spf-checker"
last_updated: "2026-10-18"
type: "tool"
summary: "Check any domain's SPF record. See the full lookup tree, the count against the limit of 10, void lookups, risky terms, and a corrected record to publish."
related: ["https://coldagentai.com/tools.md", "https://coldagentai.com/tools/dmarc-checker.md", "https://coldagentai.com/tools/dkim-checker.md", "https://coldagentai.com/tools/mx-lookup.md", "https://coldagentai.com/tools/spf-generator.md", "https://coldagentai.com/tools/domain-checker.md"]
install: "claude mcp add --transport http coldagentai-free https://coldagentai.com/api/mcp"
---

# SPF Checker with Lookup Tree and Lookup Count

> **For AI agents:** the complete index of ColdAgentAI pages is [llms.txt](https://coldagentai.com/llms.txt). Every page is also served as markdown at its URL plus .md.

Check any domain's SPF record. See the full lookup tree, the count against the limit of 10, void lookups, risky terms, and a corrected record to publish.

SPF is the DNS record that tells receiving mail servers which servers may send mail for your domain. This checker reads the record, follows every include and redirect, counts the DNS lookups against the limit of 10 that receivers enforce, and tells you in plain words what to change. It also shows the full lookup tree with the cost of each record, so you can see which include is eating your budget.

The domain you type is sent to our server, which reads its public DNS records through 1.1.1.1 and 8.8.8.8 and returns the result; nothing is stored, and each visitor can run 20 checks a minute.

## Inputs

- A domain such as example.com, or a full email address. Only the part after the last @ is used.
- No scheme, port, path or IP address. Names that are not public domains are refused.

## How it works

- We read the TXT records at your domain and keep the ones that start with v=spf1, in any letter case. Strings split across several 255 character pieces are joined before reading, as the standard requires.
- Zero records is a fail, and so is more than one: receivers treat several SPF records as a permanent error and SPF fails for every message. When that happens we list the records and propose one merged record that keeps each term once.
- With one record, we read each term and its qualifier (plus, minus, tilde or question mark). The terms include, a, mx, ptr and exists cost one DNS lookup each, and so does a redirect that applies. Every lookup inside an included or redirected record counts too, all the way down. ip4, ip6 and all cost nothing.
- We keep walking past the limit so you see the true total, and stop only at a safety cap of 40 lookups, in which case the page says "or more". The total fails above 10 and warns at 8 or 9.
- We also count void lookups, which are lookups that return nothing. More than two draws a warning, because the standard says receivers should stop after that.
- A loop, where record A includes record B and B includes A, is detected and reported instead of followed. Nesting is cut off at 10 levels.
- A lookup that fails with a server error is reported as "could not read". It is never reported as "no record", because that would tell you to publish something you may already have.

## What the lookup limit is and why it matters

RFC 7208 section 4.6.4 limits a receiver to 10 DNS-querying terms while it evaluates one SPF policy. The terms that count are include, a, mx, ptr and exists, plus the redirect modifier. Lookups inside every included record count toward the same 10. When the total passes 10, the receiver stops and returns a permanent error, and the message fails SPF no matter how correct your list of senders is.

This is why a record that looks short can still fail. One include for a large email platform can itself contain several more includes. Add a second and third service, a marketing tool and a help desk, and you can reach 11 without writing more than four terms. The lookup tree on this page shows each include with its own cost and the cost of everything beneath it, so the expensive branch is easy to spot.

## How to read the result

Start with the status. A fail means receivers will probably treat your SPF as broken: no record, two records, a loop, more than 10 lookups, or a term that is not valid. A warning means SPF works but something is risky: the count is 8 or 9, the record ends in +all or ?all, which permit everyone, it has no closing all term at all, or it uses ptr, which the standard marks as do-not-use.

The closing term matters. A tilde (~all, soft fail) tells receivers that mail from unlisted servers is suspicious. A minus (-all, hard fail) asks them to reject it. Both are legitimate. Soft fail is the usual place to start while you confirm that every service that sends for you is listed, and we show it as information, not as a problem.

## Common mistakes

The most common mistake is publishing a second SPF record when you add a new service, instead of adding the new include to the existing one. A domain must have exactly one. The second most common is leaving includes for services you stopped using, which spend lookups for nothing. A third is an include with a typo, which returns nothing and counts as a void lookup.

If you pass the limit, first delete unused includes. If you still pass, you can flatten a rarely changing include by replacing it with the ip4 and ip6 ranges it resolves to. Flattening costs no lookups, but the provider can change its addresses at any time, and your record will then be out of date. Only flatten what rarely changes, and check the result again on a schedule.

## What to do next

After SPF passes, check DKIM and DMARC, because mailbox providers look at all three together. DMARC is the record that tells receivers what to do when SPF and DKIM fail, and it is the one the large providers ask bulk senders to publish. If your domain has no SPF record yet, our SPF generator builds one from the services you tick.

## Worked example

Input:

```
shop.example.com
```

Result:

```
SPF report for shop.example.com
v=spf1 include:mail.example.net include:crm.example.net mx ~all

DNS lookups: 5 of 10. Void lookups: 0.
shop.example.com: 3 here, 5 with everything below
  include:mail.example.net: 1 here, 1 with everything below
    include:relay.example.net: 0 here, 0 with everything below
  include:crm.example.net: 1 here, 1 with everything below

INFO: ~all (soft fail) tells receivers that unlisted servers are suspicious. It is the usual choice while you confirm every sender; -all (hard fail) is stricter. Move to -all once every sender is listed.
```

## Limits

- The check reads DNS from two public resolvers at the moment you run it. A change you made seconds ago can take up to the record's TTL to show.
- We do not evaluate the policy for a particular sending address. We check the record itself: its count, its terms and its closing term.
- Macros (terms containing %) are listed but not expanded, so an exists term that uses one is counted but not probed.
- The merged record we propose for a double publication is a starting point. Check each term still belongs there before you publish it.
- Providers change their sending addresses. A flattened record can go stale without any warning from us.

## Questions

**How many DNS lookups may an SPF record use?**

Ten. RFC 7208 section 4.6.4 limits a receiver to 10 DNS-querying terms per evaluation: include, a, mx, ptr, exists and the redirect modifier, counting everything inside included records. Past 10 the receiver returns a permanent error and SPF fails.

**Why does my SPF fail when every sender is listed?**

The usual cause is the lookup limit. Includes nest, so a few terms can add up to more than 10 lookups. Run the check and read the lookup tree to see which include costs the most.

**Can a domain have two SPF records?**

No. A domain must not publish records that make a receiver select more than one, and a receiver that finds two returns a permanent error. Merge them into a single v=spf1 record.

**What is a void lookup?**

A lookup that returns no data, such as an include or a term that points at a name with no records. RFC 7208 says receivers should limit these to two, so we warn above two.

**Should I end my record in ~all or -all?**

Either is valid. ~all marks mail from unlisted servers as suspicious and is a safe start while you confirm every sender. -all asks receivers to reject it, so use it only after every real sender is listed.

**Is the ptr term safe to use?**

Avoid it. RFC 7208 section 5.5 is titled "ptr (do not use)": it is slow, unreliable, and costs a lookup. Replace it with ip4, ip6 or include terms.

**What does flattening an SPF record mean?**

Replacing include terms with the ip4 and ip6 ranges they resolve to, so they stop costing lookups. The risk is that the provider changes its addresses and your copy goes stale, so mail starts failing SPF.

## Sources

- [RFC 7208: Sender Policy Framework (SPF)](https://www.rfc-editor.org/rfc/rfc7208) (read 2026-10-18)
- [Google Workspace Admin Help: Set up SPF](https://support.google.com/a/answer/33786) (read 2026-10-18)
- [Microsoft Learn: Create DNS records at any DNS hosting provider](https://learn.microsoft.com/en-us/microsoft-365/admin/get-help-with-domains/create-dns-records-at-any-dns-hosting-provider) (read 2026-10-18)
- [Zoho Mail Help: SPF configuration](https://www.zoho.com/mail/help/adminconsole/spf-configuration.html) (read 2026-10-18)
- [Fastmail Help: Manual DNS configuration](https://www.fastmail.help/hc/en-us/articles/360060591153-Manual-DNS-configuration) (read 2026-10-18)

## Related tools

- [DMARC checker](https://coldagentai.com/tools/dmarc-checker.md)
- [DKIM checker](https://coldagentai.com/tools/dkim-checker.md)
- [MX lookup](https://coldagentai.com/tools/mx-lookup.md)
- [spf-generator](https://coldagentai.com/tools/spf-generator.md)
- [domain-checker](https://coldagentai.com/tools/domain-checker.md)
- [Email blacklist checker](https://coldagentai.com/tools/email-blacklist-checker.md)

## Related

- [Free cold email tools](https://coldagentai.com/tools.md)
- [DMARC checker with rollout steps](https://coldagentai.com/tools/dmarc-checker.md)
- [DKIM Checker: Find and Test a DKIM Record](https://coldagentai.com/tools/dkim-checker.md)
- [MX Lookup: Mail Servers, Provider and Fallback](https://coldagentai.com/tools/mx-lookup.md)
- [SPF record generator](https://coldagentai.com/tools/spf-generator.md)
- [Domain email checker: SPF, DMARC, MX](https://coldagentai.com/tools/domain-checker.md)
