How do I get my SPF record under the 10 DNS-lookup limit?

A receiving server may follow no more than 10 DNS-dependent terms while checking your SPF record, including everything your includes pull in, and past that point it gives up with a permanent error. You fix it by finding where the lookups go, deleting the ones you no longer need, swapping stable names for fixed addresses, and giving heavy senders a subdomain of their own.

Last reviewed: 21 October 2026.

Which SPF terms spend a lookup

Six kinds of term cost one lookup each when a receiver reaches them, inside includes too (include, a, mx, ptr, exists and redirect), while ip4, ip6, all and exp cost nothing.

Read moreShow less: Which SPF terms spend a lookup

RFC 7208, the SPF standard, splits the terms of a record into two groups. The first group makes the receiver ask DNS something before it can decide: the include, a, mx, ptr and exists mechanisms and the redirect modifier. The standard says receivers MUST cap the total of those terms at 10 during one evaluation and MUST return "permerror" once the cap is exceeded.

The second group needs no query at evaluation time: ip4, ip6 and all, plus the exp modifier, which is looked up only after a fail, to fetch explanation text. None of those count, however many you list. Terms after all are never tested, so they don't count either.

Two details catch people out:

  • Nesting counts. An include costs one lookup for itself, and every counted term inside the record it fetches is added to your total. A record with four includes can easily spend nine.
  • Terms, not packets. The limit is on terms evaluated, not on queries sent, so caching doesn't help. Microsoft's documentation makes the same point when it says lookups "can be different than the number of DNS queries".

A tally for an illustrative record (sample values, not a real domain):

v=spf1 ip4:192.0.2.10 a mx include:_spf.example.net include:mail.example.org -all

ip4:192.0.2.10              0
a                           1
mx                          1
include:_spf.example.net    1  + 2 includes inside it = 3
include:mail.example.org    1
-all                        0
                           --
total                       6 of 10

The extra limits inside mx and ptr

An mx or ptr term counts once toward the 10, but each one may also look up no more than 10 addresses on its own.

Read moreShow less: The extra limits inside mx and ptr

An mx term first asks for the domain's MX records, and that query is the one counted toward the 10. It then needs the address of every mail server in the answer, and RFC 7208 caps that second step separately: one mx term MUST NOT need more than 10 address (A or AAAA) queries, or the term itself produces a permerror. A domain with 11 or more MX hosts therefore breaks any mx term that points at it.

ptr has the same ceiling of 10 address lookups, with a softer outcome: names beyond the first 10 are simply ignored. The standard says ptr SHOULD NOT be published anyway.

Our SPF checker counts each mx and ptr term as one lookup, reports an mx term whose domain has more than 10 MX hosts under "SPF record has errors", and warns with "Uses the ptr mechanism" whenever ptr appears anywhere in the tree before an all.

Void lookups, the budget of two

A term that points at a name with no records is a void lookup, and the standard recommends that receivers stop after two of them.

Read moreShow less: Void lookups, the budget of two

A void lookup is a counted term whose DNS answer comes back empty: either the name doesn't exist, or it exists but holds nothing of the type asked for. RFC 7208 says receivers SHOULD limit void lookups to two, may make that number configurable, and recommends two as the default; going past it produces a permerror. Because it's a SHOULD rather than a MUST, a receiver is allowed to set a different number or skip the check, but you can't tell which receivers enforce it, so treat two as the budget.

The standard's security section explains why: "the names used in the record needn't exist" for a record to turn receivers into a source of junk queries aimed at someone else.

Empty names often come from retired servers and old service names. Our checker counts one when an a name has no IPv4 address (a receiver checking an IPv4 connection asks only for A records), an mx name has no MX records, an exists name has no A record, or an include's name returns no TXT records, and shows the running total in Technical details as "void lookups: 0 of 2". More than two raises a warning naming the count.

What receivers do after the tenth lookup

Evaluation stops with a permerror at the moment an 11th counted term is needed, so mail matched earlier still passes and everything later cannot.

Read moreShow less: What receivers do after the tenth lookup

SPF is read left to right, and the first matching term ends the evaluation. A receiver that matches your sender on an ip4 range near the start never touches the expensive includes further along. That is why an over-limit record can look fine for months: the error only fires for mail that needs the receiver to go past the tenth counted term.

Once it fires, the result is permerror, which RFC 7208 defines as records that "could not be correctly interpreted", and the standard's appendix leaves the next step to local policy: reject the message or deliver it, perhaps with a note. A receiver that rejects during the SMTP conversation SHOULD use reply code 550 and, where supported, the enhanced status code 5.5.2. Microsoft's documentation says the receiving system rejects the message with a bounce reading "The message exceeded the hop count." or "The message required too many lookups." Google's troubleshooting page warns that the wording varies by provider and can even look like a complaint that you have no SPF record at all.

For DMARC the picture is simpler. RFC 9989 only treats the SPF domain as authenticated when SPF returns "pass", so a permerror contributes nothing. Mail can still pass DMARC through an aligned DKIM signature, so a lookup problem can show up as DMARC failures for one service rather than as bounces. Forgeries are affected too: a sender you never listed now gets a permerror instead of the plain fail your -all was meant to deliver.

Cutting the count, safest step first

Delete includes nothing uses, drop duplicates, swap only stable names for addresses, and move bulk senders to their own subdomain before you consider flattening.

Read moreShow less: Cutting the count, safest step first

1. Remove what no longer sends. Google's own advice is to drop includes for third parties that no longer send mail for your domain, such as a helpdesk you replaced. Before deleting one, check a recent message from that service in the header analyzer. If its smtp.mailfrom domain is the service's own rather than yours, your include for it isn't consulted for that mail anyway.

2. Remove duplicates and empty branches. Two includes that publish the same ranges, or an include whose record lists no addresses, spend lookups and authorise nothing extra.

3. Swap a and mx for addresses only when they're stable. If mx points at your own single mail server with an address that hasn't changed in years, ip4: with that address (plus ip6: if it also has an IPv6 address) does the same job for free. If the name belongs to someone else, has many addresses or a short TTL, keep the name. A quick DNS lookup of the name shows both.

4. Give bulk senders a subdomain. SPF is evaluated for the exact domain in the envelope sender, so a subdomain starts with a fresh budget of 10. Microsoft recommends sending through services you don't control from a subdomain such as marketing.example.com, partly for that reason. Under DMARC's default relaxed alignment, SPF passing for the subdomain still aligns with a From address at the parent domain. An illustrative before and after:

Before  example.com       v=spf1 include:_spf.example.net include:bulk.example.org include:crm.example.net -all
After   example.com       v=spf1 include:_spf.example.net include:crm.example.net -all
        news.example.com  v=spf1 include:bulk.example.org -all

5. Flatten only what is documented as fixed. Flattening means replacing an include with the addresses it currently returns. Microsoft calls it appropriate for vendors with stable, documented ranges and asks customers not to do it with include:spf.protection.outlook.com, because its sending addresses "change frequently". If you do flatten, Microsoft's advice is to record what you replaced and when, watch the vendor's documentation, and review the copied entries at least every quarter. A stale copy fails silently: the service's new servers simply stop passing.

Worked examples: etsy.com, oracle.com and apple.com, checked 21 October 2026

Etsy's record needed 11 lookups and failed our check, Oracle's used exactly 10, and Apple's used 2.

Read moreShow less: Worked examples: etsy.com, oracle.com and apple.com, checked 21 October 2026

etsy.com: over by one. Our checker returned "Too many DNS lookups: 11 (limit 10)" with the summary "SPF is published but has an error, so receivers can't use it for some or all of this domain's mail." The record opens with 11 ip4 ranges, which cost nothing, then spends 10 lookups at the top level: nine includes plus one a term. The tenth is the last include, spf.redpoints.com, whose own record begins with include:_spf.google.com, and that is the 11th.

v=spf1 [11 ip4 ranges] include:servers.mcsv.net include:mail.zendesk.com include:amazonses.com
  include:_netblocks.google.com include:_netblocks2.google.com include:_netblocks3.google.com
  a:web.q4press.com include:cvent-planner.com include:mail.clinchtalent.com include:spf.redpoints.com -all

Reading left to right, nearly everything is matched in time. On the day we checked, every range in _spf.google.com was already covered by the two Google netblock includes listed earlier, so mail from any address Google lists there matches before the limit. Two kinds of mail do lose out. One is the address ip4:51.254.5.30, which sits in the spf.redpoints.com record after the over-limit include and so can never pass. The other is any server Etsy never listed, which gets a permerror instead of the fail that -all asks for. Etsy's DMARC record is p=reject, so mail from that address passes DMARC only with an aligned DKIM signature.

Two terms are worth a closer look. A DNS lookup of _netblocks3.google.com returned only v=spf1 ~all, a record with no addresses, so on that day removing it would have changed nothing except the total, bringing it to 10. By contrast, a:web.q4press.com is a poor candidate for swapping to ip4: it returned nine addresses with a 60-second TTL, the signature of a name that moves.

oracle.com: exactly at the limit. Our checker said "SPF is set up correctly and uses 10 of its 10 allowed lookups." Six top-level includes cost six, and three of them nest one, two and one more. It passes today, but one more counted term anywhere in that tree, added by Oracle or by one of its providers, would tip it over.

apple.com: plenty of headroom. Two includes, _spf.apple.com and _spf-txn.apple.com, each holding only ip4 ranges, so the total is 2 of 10. usps.com goes further still with v=spf1 ip4:56.0.0.0/16 -all and zero lookups. Run the health check on your own domain to see where it sits on that range.

Questions about the SPF lookup limit

Answers on the "too many DNS lookups" error, nested includes, bounces and flattening.

What does "SPF too many DNS lookups" mean?

It means evaluating your SPF record, with every include followed, needs more than the 10 DNS-dependent terms the standard allows. The receiver stops at the point it would need the 11th and returns permerror, so any message not already matched by then can't get an SPF pass. The fix is to bring the total to 10 or fewer.

Why does my record show 14 lookups when I only see five includes?

Each include brings its provider's record along, and that record can hold includes, a, mx or exists terms of its own. The include tree in our SPF checker shows how many lookups each record in the chain spends, so you can see which service's branch is using the most.

Will my emails bounce if SPF goes over 10 lookups?

Some will, at some receivers. Mail matched before the tenth counted term still passes. Mail that needs the receiver to go further gets a permerror, and the standard leaves the response to each receiver, which may reject the message or deliver it and lean on DKIM and DMARC instead. Microsoft's documentation describes a rejection with a bounce message for this case.

Is SPF flattening safe?

Only for addresses documented as fixed that you will recheck regularly. A copied list works until the provider changes its servers, then that mail fails without warning, which is why Microsoft asks customers not to flatten its Microsoft 365 include.

Related guides, tools and problems

Count your lookups with the SPF checker, then follow the page that matches what you find.