# SPF PermError: Too Many DNS Lookups, and How to Fix It URL: https://warmerly.com/blog/spf-permerror-too-many-dns-lookups Published: 2026-10-14 Reading time: 6 minutes Tags: DNS, Authentication, Troubleshooting > SPF allows 10 DNS lookups. Go over and receivers see a permerror. How to count them, what is safe to remove, and when flattening helps or hurts. Your SPF record has a hard limit of 10 DNS lookups. If checking it takes more than that, the result is a permerror, and most receivers then treat the domain as having no valid SPF. The fix is to cut the lookups under 10: remove vendors you no longer send from, swap lookups for fixed IP addresses where you control the server, and move different senders onto different subdomains. > **How this was checked**: The limits come from RFC 7208, the SPF standard. The counting rules match what Warmerly's free SPF checker does, and we wrote that checker. No prices or statistics are used on this page. ## What counts towards the 10 RFC 7208 counts every term that makes the receiver ask DNS another question: include, a, mx, ptr and exists, plus the redirect modifier. Terms that carry an address, ip4 and ip6, cost nothing, and neither does all. The count is recursive. One include that pulls in three more includes costs four. **What costs a DNS lookup in an SPF record (RFC 7208)** | Term | Counts as a lookup? | Note | | --- | --- | --- | | include:vendor.example | Yes, plus everything inside it | Marketing and helpdesk tools often nest several more | | a, a:host | Yes | One per term | | mx | Yes | Each MX host is also looked up, with its own cap of 10 | | redirect= | Yes | Same as include for counting | | exists: | Yes | Rare in practice | | ptr | Yes, and the RFC says not to use it | Slow and unreliable; remove it | | ip4:, ip6: | No | The cheapest way to authorise a server you control | | all | No | Always the last term | The standard also tells receivers to stop after two lookups that return nothing (void lookups). An include for a vendor whose DNS no longer exists can therefore break the record even when you are under 10. ## How to count your own lookups 1. Read your record with a DNS lookup tool, or paste the domain into the free SPF checker. Warmerly's checker resolves every include and redirect and reports the total, so you do not add up nested includes by hand. 2. Look at the number. 10 or fewer is valid. 11 or more is a permerror. 3. List every include and write down which sender it belongs to. Most records grow one tool at a time and nobody removes the old ones. ## How to get under 10 1. Delete senders you no longer use. A newsletter tool you cancelled last year is often still in the record. 2. Remove ptr, and replace a and mx with ip4 or ip6 if the address is fixed and you control it. 3. Check for two SPF records. A domain may publish only one SPF record. Two records is its own permerror, and the cure is to merge them into one line, not to keep both. 4. Give each sender its own subdomain. Send marketing from a subdomain with one record and cold outreach from a separate domain with another. Each name gets its own budget of 10. 5. Check every ip4 and ip6 term is a real address. An IPv6 address pasted after ip4: looks fine to a person and voids the whole record. Warmerly's checker flags these. ## Should you flatten the record? Flattening replaces includes with the IP addresses inside them, so the lookup count drops to nearly zero. It works on the day you do it. The risk is that vendors change their sending addresses, and your flattened copy does not follow. When that happens, real mail from that vendor starts failing SPF and nothing tells you. Flatten only with a service or script that refreshes the record automatically, and treat a hand-flattened record as something to re-check every month. ## Does a permerror stop your mail from arriving? Not by itself. DMARC passes if either SPF or DKIM passes and aligns with your From domain. So a permerror on SPF with working, aligned DKIM often still passes DMARC. Do not rely on that, though. A broken SPF removes one of your two checks, and some receivers weigh SPF failures on their own. **Check your own records** - [Free SPF checker: lookup count, duplicate records and the ending](https://warmerly.com/spf-checker) - [Free DKIM checker](https://warmerly.com/dkim-checker) - [Free DMARC checker](https://warmerly.com/dmarc-checker) - [Free SPF record generator: rebuild the record and count its lookups](https://warmerly.com/spf-record-generator) --- Source: https://warmerly.com/blog/spf-permerror-too-many-dns-lookups Full content index: https://warmerly.com/llms-full.txt Site index: https://warmerly.com/llms.txt