Free tool

SPF checker: look up and test your SPF record

Enter a domain to read its SPF record, follow every include and redirect, and count the DNS lookups against the limit of 10. Each problem comes with a plain explanation and the change that fixes it.

What an SPF record is

SPF, short for Sender Policy Framework, is a TXT record on your domain that lists the servers allowed to send mail using it. It always starts with v=spf1 and usually ends with an all term. A domain that sends only through Google Workspace might publish "v=spf1 include:_spf.google.com ~all".

When a message arrives, the receiving server looks at the domain in the envelope sender, the address bounces go back to, which is often called the Return-Path. It fetches that domain's SPF record and checks whether the connecting server's IP address is on the list. The rules are set out in RFC 7208.

SPF doesn't look at the From address your reader sees. DMARC is what ties the two together, which is why an SPF pass alone may not be enough. The DMARC checker explains how alignment works.

How the checker reads your record

It fetches every TXT record on the domain and picks out the ones starting with v=spf1. Then it follows the record the way a receiver would:

  • Each include is opened and its own SPF record read, along with any includes inside it.
  • A redirect is followed to the record it points at.
  • Every term that needs a DNS query is counted, across all those records, against the limit of 10.
  • The walk stops after 20 records, so a record that loops back on itself can't keep the check running.
  • The all term at the end is read to see what happens to mail from servers that aren't listed.

The SPF result opens first on this page, with the full record and every problem listed under it. The other four checks of the email health check still run underneath, so you see the whole picture in the same place.

Every problem it reports, and how to fix it

Each problem appears as a fail or a warning, with the reason in one sentence beside it. This is what each one means and what to change:

  • No SPF record (fail): receivers have nothing to check your servers against. Publish one TXT record on the domain listing every service that sends as you, ending in ~all or -all.
  • More than one SPF record (fail): RFC 7208 treats this as a permanent error, so receivers act as if SPF were broken. Merge them into a single record with one v=spf1 at the start, every include from both, and one all term at the end.
  • More than 10 DNS lookups (fail): receivers give up partway through the record and return a permanent error. The next section covers how to cut it down.
  • 8 to 10 lookups (warning): the record still works, but adding one more service could tip it over the limit.
  • An include with no SPF record (fail): the named domain has no record of its own, which RFC 7208 also treats as a permanent error. It's usually a typo or a service you've stopped using. Correct the domain or remove the include.
  • An include loop (fail): two records include each other, directly or through others. Remove the include that points back.
  • A ptr term (warning): ptr is deprecated, slow and unreliable, and RFC 7208 says not to use it. Replace it with the ip4, ip6 or include terms for the servers it was meant to cover.
  • +all (fail): this lets every server on the internet pass SPF as your domain. Change it to ~all or -all.
  • ?all (warning): a neutral result tells receivers nothing about mail from unlisted servers. Use ~all or -all instead.
  • No all term (warning): receivers then return neutral for unlisted servers, the same as ?all. Add ~all or -all at the end.

Staying under the 10-lookup limit

Six kinds of term make the receiver query DNS: include, a, mx, ptr, exists and redirect. Terms nested inside an include count too, which is how a record with only four includes can still go over 10. The ip4, ip6 and all terms cost nothing.

Ways to bring the count down, starting with the safest:

  • Remove includes for services you no longer use. Old newsletter tools and past helpdesk software are common leftovers.
  • Check whether each sending service needs to be in your SPF record at all. Many send with their own bounce domain in the envelope, so your record is never consulted, and their DKIM signature is what makes DMARC pass.
  • Replace a and mx terms with ip4 or ip6 when the addresses are your own and rarely change.
  • Move a service onto a subdomain such as mail.example.com, with an SPF record of its own.

Some people flatten their record, replacing includes with the IP addresses behind them. It gets the count down, but providers change their addresses without telling you, and a flattened record then quietly starts failing. Only do it with a tool that keeps the list up to date for you.

Should you end with -all or ~all?

Both pass this check. With -all, a hard fail, you tell receivers that mail from any unlisted server is not yours. With ~all, a soft fail, you say it probably isn't, and leave the decision to them.

If you have DMARC in place, ~all is a reasonable choice, because DMARC then decides what happens to failing mail and DKIM can still rescue a message SPF fails. Some receivers reject on an SPF hard fail before they look at DKIM, which can catch forwarded mail. If the domain sends no email at all, publish "v=spf1 -all" so nobody can pass SPF while pretending to be you.

Notes for common email providers

  • Google Workspace: include:_spf.google.com covers mail sent from Gmail with your domain.
  • Microsoft 365: include:spf.protection.outlook.com covers mail sent from Outlook and Exchange Online.
  • Sending services: copy the include from the service's own setup guide, and add it to your existing record rather than publishing a second one.
  • Long records: a single string in a TXT record holds at most 255 characters. Longer SPF records are split into several quoted strings within one TXT record, which receivers join back together. Most DNS hosts do this for you, but some need you to add the quotes yourself.

A domain used for cold email should list only the services that actually send from it. Boost Sales AI sends from separate domains it runs and keeps healthy, so your own SPF record never has to cover cold email and your everyday mail is kept apart from it. It also finds your buyers, writes and sends each email, and handles follow-ups and replies. You can preview your buyers and sample emails free first.

FAQ

Questions people ask

Can a domain have two SPF records?

No. RFC 7208 allows one SPF record per domain, and a domain with two returns a permanent error, so SPF fails for every message. Combine them into one record that lists every sender.

What happens when an SPF record goes over 10 lookups?

Receivers stop evaluating it and return a permanent error, which counts as SPF not passing. Under DMARC, your mail then has to rely on DKIM alone, and any message that isn't signed with your domain fails outright.

Does SPF cover subdomains?

No. SPF is checked for the exact domain in the envelope sender, so a record on example.com does nothing for mail sent from news.example.com. Each subdomain that sends needs its own SPF record.

Why does SPF pass but DMARC fail?

SPF passed for the bounce domain your sending service used, which isn't your domain. DMARC needs the domain that passed to match the one in the From line. Set up a custom bounce domain with the service, or make sure it signs with DKIM using your domain.

How long does an SPF change take to work?

Receivers see the new record once their cached copy expires, and the record's TTL sets how long that takes. Your DNS host shows the TTL next to each record. Run the checker again after that time to confirm what receivers now see.

Free preview

See who would buy from you

Type your domain and see your buyers and the emails we'd send them, free. If you go ahead, it's $99 a month or $990 a year.