SPF record checker

Count SPF DNS lookups against the limit of 10, see every include, and find what causes PermError.

Test a record before publishing
Includes are still looked up in DNS, so you see the real lookup count before you change anything.

Only domain names leave this page: they go over HTTPS to Cloudflare's public DNS resolver, or Google's if Cloudflare doesn't answer.

DNS lookupslimit 10
—
Result
—
Empty lookups
—

Record

—

Record tree

    Everything runs in your browser. What you enter stays on this device and is remembered only in this browser. The only thing sent out is an anonymous page view count to Cloudflare Web Analytics, without cookies.

    How to use it

    1. Type your domain and press Check. The page fetches the SPF record and every record it includes, and counts the DNS lookups the way a receiving server does.
    2. Look at the count first. Over 10 is PermError; 9 or 10 means one change by any of your providers will break it.
    3. Open the tree to see which include costs how many lookups. Providers often nest several records inside one include.
    4. Planning a change? Paste the new record under “Test a record before publishing” and check it against the live includes before you touch DNS.

    The 10-lookup limit

    RFC 7208 limits an SPF check to 10 DNS lookups, counted across all nested records. Six terms count: include, a, mx, ptr, exists and redirect. The terms ip4, ip6 and all are free, and so is the lookup of your own record. Go over 10 and the receiver stops with PermError, which DMARC treats as an SPF failure for every message, including your legitimate ones.

    There is a second, less known limit: no more than two lookups may come back empty, for example an include that points to a domain that no longer exists. A third empty answer is also PermError.

    How to get under 10

    • Remove what you no longer use. Old newsletter tools and help desks are the usual suspects.
    • Check whether a service needs to be in your record at all. SPF checks the bounce (Return-Path) domain, not the From domain. If a service sends with its own bounce domain and signs with DKIM for your domain, DMARC passes through DKIM and the include is not needed (RFC 7489).
    • Move bulk mail to a subdomain such as news.yourcompany.com with its own SPF record and its own 10 lookups.
    • Flattening replaces an include with the IP ranges behind it. It works, but providers change their ranges without notice, so a flattened record needs to be refreshed automatically.

    Frequently asked questions

    What does SPF PermError mean?

    The record could not be evaluated: too many DNS lookups, more than two empty lookups, two SPF records on one domain, a syntax error, or an include of a domain that has no SPF record. Receivers treat it as broken SPF, so SPF does not pass for any message from that domain.

    Can I have two SPF records?

    No. A domain must publish exactly one TXT record starting with v=spf1; two of them are PermError. Merge them into one record with all the includes.

    Should I end with ~all or -all?

    ~all (softfail) asks receivers to accept unlisted servers but treat them with suspicion; -all (fail) says they are not allowed. With DMARC in place, receivers act on the DMARC policy either way. Never use +all: it authorizes every server in the world.

    Does the count match what MXToolbox and others show?

    It should, give or take checkers that also count lookups the standard leaves out, such as the first lookup of your own record. This page counts exactly what RFC 7208 lists and shows each lookup in the tree.

    What is sent when I press Check?

    Only the domain names in the record, as DNS queries over HTTPS to Cloudflare's public resolver, or Google's if Cloudflare doesn't answer. Your draft record itself is never sent; the example on first load makes no queries at all.