SPF Checker

Validate your SPF record, count its DNS lookups and get clear fixes.

A

Grade

Excellent

SPF record of microsoft.com

v=spf1 include:_spf-a.microsoft.com include:_spf-b.microsoft.com include:_spf-ssg-a.msft.net include:_spf1-meo.microsoft.com -all
DNS lookups
6 / 10
Void lookups
0 / 2

Results

  • Ok: "-all" (hard fail): mail from unlisted servers should be rejected.
  • Ok: 6 of 10 allowed DNS lookups used.

What this record means

include:_spf-a.microsoft.com Also authorizes the servers listed in the SPF record of _spf-a.microsoft.com.
include:_spf-b.microsoft.com Also authorizes the servers listed in the SPF record of _spf-b.microsoft.com.
include:_spf-ssg-a.msft.net Also authorizes the servers listed in the SPF record of _spf-ssg-a.msft.net.
include:_spf1-meo.microsoft.com Also authorizes the servers listed in the SPF record of _spf1-meo.microsoft.com.
-all Any other server: fail (reject).

Include tree

  • microsoft.com
    v=spf1 include:_spf-a.microsoft.com include:_spf-b.microsoft.com include:_spf-ssg-a.msft.net include:_spf1-meo.microsoft.com -all
    • _spf-a.microsoft.com
      v=spf1 ip4:216.99.5.67 ip4:216.99.5.68 ip4:202.177.148.100 ip4:203.122.32.250 ip4:202.177.148.110 ip4:213.199.128.139 ip4:213.199.128.145 ip4:207.46.50.72 ip4:207.46.50.82 ip4:65.55.42.224/28 include:spf.protection.outlook.com ~all
      • spf.protection.outlook.com
        v=spf1 ip4:40.92.0.0/15 ip4:40.107.0.0/16 ip4:52.100.0.0/15 ip4:52.102.0.0/16 ip4:52.103.0.0/17 ip4:104.47.0.0/17 ip6:2a01:111:f400::/48 ip6:2a01:111:f403::/49 ip6:2a01:111:f403:8000::/51 ip6:2a01:111:f403:c000::/51 ip6:2a01:111:f403:f000::/52 -all
    • _spf-b.microsoft.com
      v=spf1 include:_spf-mdm.microsoft.com ip4:207.46.22.35 ip4:207.46.22.98/29 ip4:217.77.141.52 ip4:217.77.141.59 ip4:203.32.4.25 ip4:23.103.224.0/19 ip4:206.191.224.0/19 ip4:65.52.80.137/32 ~all
      • _spf-mdm.microsoft.com
        v=spf1 ip4:134.170.113.0/26 ip4:131.253.30.0/24 ip4:157.56.120.128/26 ip4:134.170.174.0/24 ip4:134.170.141.64/26 ip4:134.170.143.0/24 ip4:157.58.249.3 ip4:65.55.29.77 ip4:131.253.121.0/26 -all
    • _spf-ssg-a.msft.net
      v=spf1 ip4:104.44.112.128/25 ip4:134.170.27.8 ip4:157.58.30.128/25 ip4:20.63.210.192/28 ip4:20.94.180.64/28 ip4:40.112.65.63 ip4:52.185.106.240/28 ip4:52.234.172.96/28 ip4:52.236.28.240/28 ip4:66.119.150.192/26 ~all
    • _spf1-meo.microsoft.com
      v=spf1 ip4:52.235.253.128 ip4:20.141.10.196 ip4:20.118.139.208/30 ip4:20.98.194.68/30 ip4:20.83.222.104/30 ip4:20.88.157.184/30 ip4:20.59.80.4/30 ip4:20.51.6.32/30 ip4:20.97.34.220/30 ip4:20.107.239.64/30 ip4:20.105.209.76/30 ip4:20.98.148.156/30 ip4:20.69.8.108/30 ~all

Now check the DMARC record of microsoft.com →

What is an SPF record?

SPF (Sender Policy Framework, RFC 7208) is a DNS TXT record that lists the servers allowed to send email for your domain. When a mail server receives a message claiming to come from your domain, it looks up your SPF record and checks whether the sending server's IP is on the list. If it is not, the message can be rejected or marked as spam.

A typical SPF record looks like this:

v=spf1 ip4:203.0.113.0/24 include:_spf.google.com include:sendgrid.net ~all

It says: "my own servers in 203.0.113.0/24, Google Workspace and SendGrid may send mail for me; treat everything else as suspicious."

How to use the SPF checker

  1. Enter your domain (for example example.com). URLs and www. are cleaned up automatically.
  2. The checker fetches your SPF record, follows every include and redirect, and counts the DNS lookups.
  3. You get a grade from A to F, a list of problems in plain English, an explanation of every part of the record and the full include tree.

How to read the results

  • Grade: A means no problems. Each warning lowers the grade a little, each error a lot. A missing record, multiple records or +all always get an F.
  • DNS lookups (x / 10): the number of DNS queries a receiver needs to evaluate your record, including nested includes. Above 10, SPF fails.
  • Void lookups (x / 2): lookups that return nothing, such as an include for a domain without SPF. More than 2 is also a permanent error.
  • What this record means: each mechanism of your record translated into a sentence.
  • Include tree: every record you include and the records they include, so you can see where your lookups go.

SPF mechanisms and qualifiers

MechanismMeaningDNS lookup?
ip4: / ip6:An IP address or range that may send.No
aThe IPs in the domain's A/AAAA records.Yes
mxThe IPs of the domain's mail servers.Yes
include:Everything the other domain's SPF record allows.Yes (plus its own lookups)
exists:Match if a name exists (advanced, used with macros).Yes
ptrMatch by reverse DNS. Deprecated, do not use.Yes
redirect=Use another domain's SPF record instead.Yes
allMatches everything else. Always the last mechanism.No

Each mechanism can have a qualifier in front: + pass (the default), - fail, ~ soft fail and ? neutral. In practice the qualifier only matters on all.

-all vs ~all vs ?all vs +all

  • -all (hard fail): mail from unlisted servers should be rejected. The strictest option and the right choice for domains that send no email at all (v=spf1 -all).
  • ~all (soft fail): accept but mark as suspicious. With DMARC in place, this is safe and very common, because DMARC makes the final decision.
  • ?all (neutral): no opinion. Gives no protection. Avoid it.
  • +all (pass): authorizes every server on the internet to send as you. It is the same as having no SPF at all, but worse, because it looks valid. Never use it.

The 10 DNS lookup limit

To protect receivers from slow or abusive records, SPF allows at most 10 DNS lookups per check. Every include, a, mx, ptr, exists and redirect counts, and so do the ones inside the records you include. Google Workspace alone uses 4, Microsoft 365 about 2, and marketing and support tools add more. Exceed the limit and receivers return permerror: SPF fails for all your mail, not just the extra senders.

How to reduce SPF lookups

  1. Remove services you no longer use. Old newsletters, CRMs and helpdesks are the usual suspects.
  2. Remove a and mx if your web and mail servers do not actually send mail directly.
  3. Use subdomains for bulk mail. Send newsletters from news.example.com with its own SPF record; it has its own 10-lookup budget.
  4. Replace includes with ip4/ip6 ranges, but only for providers with stable, documented IP ranges, because you will have to update them yourself.
  5. Avoid "SPF flattening" services unless they update automatically; a stale flattened record breaks silently when the provider changes IPs.

Common SPF errors

Multiple SPF records

A domain must have exactly one TXT record starting with v=spf1. Adding a second one when you sign up for a new service is a very common mistake, and it makes SPF fail completely. Merge them: v=spf1 include:a.com -all and v=spf1 include:b.com -all become v=spf1 include:a.com include:b.com -all.

No SPF record

Without SPF, receivers cannot tell your real mail from forgeries, and Gmail, Yahoo and Microsoft increasingly send unauthenticated mail to spam or reject it.

Include without a record

If you include a domain that has no SPF record (because of a typo or a provider that changed its setup), receivers treat the whole record as broken. Check the include tree for errors.

Syntax errors

Typos like ip4:192.168.1, include _spf.google.com (missing colon) or unknown words make the record invalid. The checker lists each invalid term.

How to create or fix your SPF record

  1. List every service that sends email as your domain: your mailbox provider, website contact forms, newsletter tool, CRM, helpdesk, invoicing software.
  2. Find the SPF include each provider documents (for example include:_spf.google.com for Google Workspace or include:spf.protection.outlook.com for Microsoft 365).
  3. Combine them into one record that starts with v=spf1 and ends with ~all or -all.
  4. Publish it as a TXT record on the root of your domain (name @) at your DNS provider.
  5. Check it here and confirm the grade and the lookup count.

SPF is not enough on its own

SPF checks the hidden "envelope" sender (Return-Path), not the From address your recipients see, and it breaks when mail is forwarded. That is why you also need DKIM (a cryptographic signature) and DMARC, which ties SPF and DKIM to the visible From address and tells receivers what to do with mail that fails. Once your SPF record gets an A, check your policy with our DMARC Checker. You can see all the TXT records of your domain with the DNS Lookup.

Frequently asked questions

What is an SPF record?

SPF (Sender Policy Framework) is a TXT record that lists the servers allowed to send email for your domain. Receivers check it to detect forged senders.

What is the SPF 10 DNS lookup limit?

Evaluating SPF may cause at most 10 DNS lookups. Each include, a, mx, ptr, exists and redirect counts, including those inside included records. Above 10, receivers return a permanent error and SPF fails for all your mail.

Should I use -all or ~all?

-all (hard fail) tells receivers to reject mail from unlisted servers; ~all (soft fail) asks them to accept but mark it. With a DMARC policy in place, ~all is safe and common. Never use +all.

Can I have two SPF records?

No. A domain must publish exactly one TXT record starting with v=spf1. If you have two, merge them into one, otherwise SPF fails.

How do I fix "too many DNS lookups"?

Remove includes for services you no longer use, replace includes with the ip4/ip6 ranges they contain (only if the provider's IPs are stable), or send some mail streams from a subdomain with its own SPF record.

Is SPF enough to protect my domain?

No. SPF only checks the hidden envelope sender, not the From address people see. You need DKIM and a DMARC policy too. Check yours with our DMARC checker.

Related tools

Last updated: