Tripline

SPF PermError: too many DNS lookups

Your SPF record needs more than 10 DNS lookups.

Receivers stop reading SPF after 10 lookups and call the whole record broken, so your real invoices and password resets fail SPF too. Check yours, then bring it back under.

Free, with no sign-up. Takes a few seconds.

What it means

SPF lists the servers allowed to send mail as your domain. Reading it can mean further DNS lookups: every include:, a, mx, ptr, exists: and redirect= costs one, and so does everything inside the records they include. The standard (RFC 7208) caps the total at 10.

Past 10, the receiver stops and returns PermError. DMARC treats that as a fail, so unless your DKIM signature passes and matches your domain, real mail is handled like a fake: spam folder, or rejected outright if your DMARC policy says so.

ip4:, ip6: and all cost nothing, which is why they are the way back under the limit.

Why it happens

Your recordv=spf1 include:_spf.google.com
include:mailgun.org include:sendgrid.net
include:servers.mcsv.net ~all

Every tool you added

Each newsletter, helpdesk, CRM and invoicing tool asks for its own include. Nobody removes the ones you stopped using.

Inside one includeinclude:_spf.example
  include:_netblocks1
  include:_netblocks2

Includes inside includes

A single include can cost three or four lookups, because providers nest their own records.

Last month: 9 · today: 11+2 without you touching DNS

Changes you didn't make

Providers edit their own records whenever they like. You can go over the limit with no change on your side.

Leftoversa mx ptr include:old-host.example

Mechanisms that send nothing

a and mx are often copied from a template even when your web and mail servers never send mail, and ptr is slow and discouraged.

How to fix it

  1. List what really sends your mail.

    Go through every include and name the service behind it. Remove any you have stopped using. This alone fixes most records.

  2. Remove mechanisms that don't send.

    Drop a, mx and ptr unless those servers actually send mail as your domain.

  3. Move bulk senders to a subdomain.

    Let your newsletter or marketing tool send from something like news.yourdomain.com, with its own SPF record. Each name gets its own 10 lookups, and your main domain's reputation is kept apart.

  4. Flatten only with a plan.

    Replacing an include with the provider's ip4: ranges costs no lookups, but providers change their ranges without telling you, and a stale record quietly fails. Only flatten what you will keep up to date, or have it watched.

  5. Check again, then keep watching.

    Run the check above. Because providers change their own records, the count can creep back over without any edit from you, which is the change a Tripline alert catches.

Common questions

Do ip4 and ip6 entries count towards the 10?

No. Only mechanisms that need a DNS lookup count: include, a, mx, ptr, exists and redirect, plus everything inside the records they pull in.

My record has six includes, so why is it over 10?

Because the records you include have includes of their own. The count follows the whole tree, which is why a checker that only counts your own record gets it wrong.

Does ~all or -all change the count?

No. The ending only says what to do with servers you didn't list. It costs no lookups.

If DKIM passes, does SPF still matter?

DMARC passes when either SPF or DKIM passes and matches your domain, so signed mail can still get through. A PermError still counts against you with some receivers and leaves mail that isn't signed unprotected, so fix it anyway.

Other fixes