SPF Record Checker and Generator

Check the SPF record of any domain, or create a new one. The SPF checker explains every part of the record and counts its DNS lookups against the limit of 10.

Try:

How to check an SPF record

  1. Type a domain into the box above. A full email address works too. The tool keeps only the domain.
  2. Click Check SPF record. The SPF record check reads the live record from public DNS, the same record a receiving server reads.
  3. Read the summary first. It tells you whether the record is valid, has warnings, or is broken.
  4. Then read the list of problems, if there are any. Each one says what to change.
  5. Below that, each part of the record is explained, with the DNS lookups it costs. Open an include to see what the service behind it allows.

The link in your address bar runs the same SPF check again, so you can send it to a colleague or your DNS host. One limit: a receiver checks SPF against the IP address of the server that sent a message. This SPF analyzer has no message to look at, so it checks the record itself. It can’t evaluate parts built from SPF macros, which change for every sending server.

Illustration of an SPF record split into its parts, with a counter showing DNS lookups used out of 10.

What is an SPF record?

An SPF record is a TXT record in a domain’s DNS. It lists the servers that may send email for that domain. SPF stands for Sender Policy Framework, and the rules are in RFC 7208. A domain that uses Google Workspace often has a record like this one:

v=spf1 include:_spf.google.com ~all

v=spf1 marks it as an SPF record. include:_spf.google.com allows every server in Google’s own list. ~all tells receivers to treat mail from any other server with suspicion.

When a message arrives, the receiving server takes the domain from the bounce address, called the Return-Path. It reads that domain’s SPF record and checks whether the sending server’s IP address is on the list. SPF does not look at the From address you see in your inbox. That is why it works together with DKIM and DMARC. For how the three fit, see SPF, DKIM and DMARC explained.

Since February 2024, Gmail requires SPF or DKIM from every sender, and both from bulk senders. Yahoo has the same rules.

What each part of an SPF record means

An SPF record is a list of terms separated by spaces. Receivers read them from left to right and stop at the first one that matches the sending server.

v=spf1Marks the TXT record as SPF. It must come first, written exactly like this.DNS lookup: No
ip4:192.0.2.10Allows one IPv4 address, or a range like 192.0.2.0/24.DNS lookup: No
ip6:2001:db8::/32Allows one IPv6 address or range.DNS lookup: No
aAllows the IP addresses of the domain itself, or of a domain you name after a colon.DNS lookup: Yes
mxAllows the servers in the domain’s MX records, the ones that receive its mail.DNS lookup: Yes
include:_spf.google.comAllows every server that another domain’s SPF record allows. This is how you add a service.DNS lookup: Yes, plus its own
exists:%{i}.example.comMatches when a DNS lookup finds an address. Large senders use it with macros.DNS lookup: Yes
ptrMatches by reverse DNS. RFC 7208 says not to use it, because it is slow and unreliable.DNS lookup: Yes
~all or -allDecides what happens to every server you didn’t list. It goes at the end.DNS lookup: No
redirect=example.netUses another domain’s SPF record instead of this one. Ignored when the record has all.DNS lookup: Yes

Any part can start with a qualifier that sets the result when it matches. + means pass and is the default, so nobody writes it. - means fail, ~ means soft fail, and ? means neutral. That is why the same word, all, can end a record as -all, ~all or ?all.

Names are not case-sensitive, so Include: works as well as include:. RFC 7208 recommends ending every record with all or a redirect. Without either, servers you didn’t list get a neutral result.

The 10 DNS lookup limit

Every include, a, mx, ptr, exists and redirect makes the receiver run a DNS lookup. RFC 7208 allows 10 in total. Lookups inside an include count too, so one include can cost several. ip4, ip6 and all cost nothing. When a record needs more than 10, receivers stop and return a permerror, and SPF fails.

The limit is easy to reach. We measured what common includes cost against live DNS: Google Workspace 1, Microsoft 365 1, Salesforce 2, Mailgun 5 and Freshdesk 7. A company on Google Workspace that adds Mailgun and Freshdesk already needs 13 lookups. A 2024 study of SPF records in .com, .net, .org and .se found that 6.5% needed more than 10 lookups. Includes of just two hosting providers’ records caused 83.7% of those cases.

Costs also change. Google’s include cost 4 lookups until December 2025, when Google replaced its nested includes with a flat list. Some SPF guides and generators still say 4. The checker above counts the real number every time you run it.

Going over the limit doesn’t always break every message. Microsoft points out that receivers stop at the first match. Mail from a server listed early can still pass, while mail from a server listed late fails. That makes the problem look random, so count the full record.

There is a second limit. A lookup that finds nothing is a void lookup, for example an include of a domain that no longer exists. RFC 7208 says receivers should stop after 2 of these.

How to get under 10 lookups

  1. Remove includes for services you no longer use.
  2. Remove includes a service no longer asks for. Mailchimp, Postmark, Brevo and Klaviyo don’t need one on your main domain, and SendGrid and Amazon SES put theirs on a subdomain. The list is further down.
  3. List your own servers with ip4 and ip6 instead of a or mx. RFC 7208 recommends this order, and IP addresses cost no lookups.
  4. Send some mail from a subdomain, such as news.example.com. Each subdomain has its own record and its own 10 lookups.

Some services offer SPF flattening, which replaces includes with the IP addresses behind them. It saves lookups, but providers change their addresses, and a flattened record doesn’t follow. Microsoft advises flattening only services with stable, documented IP ranges, never Microsoft 365 itself, and checking the result at least every quarter.

SPF includes for Google Workspace, Microsoft 365 and other services

These are the include values from each service’s setup guide, with the DNS lookups each one costs. We measured the costs against live DNS on 12 October 2026. When you set up a service, copy the value from its own guide, because some depend on your region or account.

Google Workspace · 1 lookupinclude:_spf.google.com
Microsoft 365 · 1 lookupinclude:spf.protection.outlook.com
Zoho Mail · 2 lookupsinclude:zohomail.com
Proton Mail · 2 lookupsinclude:_spf.protonmail.ch
Fastmail · 1 lookupinclude:spf.messagingengine.com
iCloud Mail · 5 lookupsinclude:icloud.com
Namecheap Private Email · 4 lookupsinclude:spf.privateemail.com
Hostinger · 3 lookupsinclude:_spf.mail.hostinger.com
GoDaddy · 3 lookupsinclude:secureserver.net
Mailgun · 5 lookupsinclude:mailgun.org
Salesforce · 2 lookupsinclude:_spf.salesforce.com
Zendesk · 1 lookupinclude:mail.zendesk.com
Freshdesk · 7 lookupsinclude:email.freshdesk.com
Mailjet · 1 lookupinclude:spf.mailjet.com

HubSpot gives every account its own include, ending in hubspotemail.net. Copy it from your HubSpot email settings. It costs 1 lookup.

Services that usually don’t need an include

SPF is checked against the bounce address, not the From address. Many sending services now use a bounce address of their own, or a subdomain of yours. An include for them on your main domain does nothing except use up lookups.

  • Mailchimp. Mailchimp’s domain setup now asks only for DKIM and DMARC records, not SPF.
  • Postmark. Postmark says SPF is no longer required. It sends with its own bounce address, or a Return-Path record you point to it.
  • Brevo. Brevo says SPF is not required unless you send from a dedicated IP address.
  • Klaviyo. Klaviyo says you usually don’t need to add an SPF record.
  • SendGrid. SendGrid’s domain authentication puts SPF on a subdomain it creates for you, such as em1234.yourdomain.com.
  • Amazon SES. SES needs it only on a custom MAIL FROM subdomain, such as bounce.yourdomain.com. By default it uses its own bounce address.

The checker flags these includes when it finds them in your record.

How to create an SPF record

Use the Create tab above to generate an SPF record. Tick the services that send your mail, and the SPF record maker writes the record and counts its lookups. If your domain already has a record, load it first, so you add to it instead of replacing it. These are the steps behind it:

  1. List every service that sends email as your domain. Think beyond your mailbox provider: newsletters, your CRM, the help desk, billing, website forms. DMARC reports show senders you forgot.
  2. Find the include for each one in its setup guide, or tick it in the tool. For your own mail servers, use their IP addresses.
  3. Choose the ending: ~all or -all. The next section explains the difference.
  4. Publish it as one TXT record on the domain itself. Most DNS hosts call that name @. If a record starting with v=spf1 already exists, edit it instead of adding a second one.
  5. Wait a few minutes and check the domain again with the SPF checker.

Each name that sends mail needs its own record, because subdomains don’t use the parent’s record. A domain or subdomain that never sends mail should still get one: v=spf1 -all. RFC 7208 calls this a well-established best practice. It stops others from sending mail that passes as that name. The UK NCSC suggests adding a DMARC record with p=reject and a null MX record to such domains too.

A record longer than 255 characters has to be split into several strings within the same TXT record. Receivers join the strings without spaces, so put the space inside a string, not between them. Check how your DNS host handles long values.

~all or -all: which ending to use

The big providers don’t agree, and each has a reason.

  • Google recommends ~all.
  • M3AAWG, an industry group whose members include large mailbox providers and senders, says records should end in ~all. It also asks receivers not to reject on an SPF fail until DMARC has run.
  • Microsoft recommends -all, as long as DKIM and DMARC are set up too.

The risk with -all is that some receivers reject the message during delivery, before DMARC is checked. RFC 9989, the 2026 DMARC standard, notes that such mail never appears in your DMARC reports. That makes problems harder to find.

In practice, ~all is the safer choice for a domain that sends mail, especially while you are still finding all your senders. If you have DMARC at quarantine or reject, DMARC decides what happens to failing mail anyway. Use -all on domains that send no mail at all. Never use +all, which lets every server pass, and avoid ?all, which counts the same as having no record.

What your SPF check result means

ResultWhat it meansWhat to do
Valid SPF recordOne record, readable, within 10 lookups, ending in ~all or -all.Nothing. Check again after you add a new service that sends mail for you.
Working SPF record with warningsReceivers can use it, but something weakens it, such as 9 or 10 lookups, no all at the end, or ptr.Fix the warnings listed under the record. They often turn into errors when you add one more service.
SPF record is brokenReceivers get a permerror, so SPF fails for all mail from the domain.Fix the errors listed. The most common are two records and more than 10 lookups.
SPF record doesn’t protect the domainThe record ends in +all, or includes a record that does, so every server on the internet passes.Change +all to ~all or -all.
No SPF recordThe domain publishes no TXT record that starts with v=spf1.Create one with the Create tab. A domain that never sends mail should get v=spf1 -all.
Domain doesn’t existDNS has no record of the domain at all.Check the spelling, and check that the domain is registered.

Receiving servers use their own words for the outcome of an SPF check. You see them in message headers, as in spf=pass or spf=softfail, and in DMARC reports:

passThe sending server is allowed.
failThe server is not allowed (-all). Receivers may reject the message.
softfailThe server is probably not allowed (~all). RFC 7208 says receivers shouldn’t reject on this alone.
neutralThe record says nothing about this server (?all). It counts the same as having no record.
noneThe domain has no SPF record.
temperrorA DNS lookup failed for a moment. The sender may retry later.
permerrorThe record is broken and can’t be read. Only a fix in DNS helps.

Common SPF record errors and how to fix them

A 2023 scan of 12 million popular domains found SPF on 56.5% of them, and errors in 2.9% of the SPF records. The most common error was an include or redirect pointing to a name with no SPF record. Too many lookups came second.

Two SPF records on one domain

This often happens when a new service’s setup guide says “add this TXT record” and someone adds it next to the old one. Two records cause a permerror. Merge them into one. Start with one v=spf1, list every include and IP address, and end with one all.

An include that points nowhere

If an include points to a domain with no SPF record, the whole record fails with a permerror. It can be a typo, or a service that shut down or changed its include. Remove it or replace it with the current value from the service.

+all, ?all or no all at the end

+all allows every server on the internet, so the record protects nothing. ?all, or no all at all, gives a neutral result, which receivers treat like no record. End the record with ~all or -all.

ptr in the record

RFC 7208 says ptr should not be used. It is slow, it costs a lookup, and it is less reliable than other mechanisms when DNS has problems. Replace it with ip4 and ip6 entries for the servers it was meant to cover.

Typing mistakes

A space after a colon, an IPv4 address with a missing part, or a word SPF doesn’t know all cause a permerror. One mistake is quieter: include=example.com with an equals sign is read as an unknown setting and skipped, so that service is never allowed. The checker flags all of these.

Three details SPF guides often get wrong

  • “An SPF record can’t contain capital letters.” RFC 7208 says names are not case-sensitive.
  • “An SPF record can be at most 255 characters.” The 255 limit applies to each string. A longer record is split into strings. RFC 7208 only asks that the whole DNS answer stay small, under about 450 bytes.
  • “You can have up to 10 includes.” The limit counts DNS lookups, and lookups inside includes count too.

SPF is one part of email authentication

An SPF pass has limits. In the same 2023 scan, 34.7% of the domains allowed mail from more than 100,000 IP addresses. SPF also breaks when someone forwards your message, because the forwarding server isn’t in your record.

DKIM signs the message itself, so it usually survives forwarding. DMARC checks that SPF or DKIM passed for the same domain as the From address, and tells receivers what to do when neither did. Many sending services pass SPF with their own bounce domain, which doesn’t match your From address. A custom Return-Path at the service fixes that. Set up the other two records with the DKIM generator and the DMARC generator, and use the MX lookup to check where your domain receives mail.

Authentication also doesn’t help with addresses that don’t exist. Mail to them bounces, and a high bounce rate hurts delivery. Check single addresses with the email checker, or a whole list with the bulk email verifier. For a short definition to share with your team, see the SPF record glossary entry.

Frequently asked questions

It’s a TXT record in your domain’s DNS that lists the servers allowed to send email for the domain. Receiving servers read it to decide whether a message really came from one of your servers. SPF stands for Sender Policy Framework and is defined in RFC 7208.

Type your domain into the SPF checker at the top of this page. From a terminal, nslookup -type=txt example.com works on Windows, and dig txt example.com works on macOS and Linux. Look for the TXT record that starts with v=spf1.

No. RFC 7208 allows one SPF record per domain name. With two, receivers return a permanent error and SPF fails for all your mail. Merge both into one record. Other TXT records, such as site verification codes, can stay.

It means the receiver couldn’t read your SPF record, so the check fails. The usual causes are two SPF records, more than 10 DNS lookups, or an include of a domain with no SPF record. A typing mistake can also cause it. The checker above names the cause.

With ~all, mail from servers you didn’t list gets a soft fail, and receivers usually accept it with more suspicion. With -all, it gets a fail, and some receivers reject it. Google recommends ~all. Microsoft recommends -all once DKIM and DMARC are set up.

Yes, if they send email. A subdomain doesn’t use the SPF record of its parent domain. If news.example.com sends mail, it needs its own record. If it never sends mail, give it v=spf1 -all.

Up to the TTL of the old record. Resolvers that cached it keep the old answer until the TTL runs out, so a TTL of 3600 means up to an hour. Google says changes can take up to 48 hours, but most show up much sooner.

It’s safer to have both. Gmail and Yahoo accept SPF or DKIM from small senders, but they require both from bulk senders. DMARC passes when either one passes and matches your From domain, so having both gives you a backup.

Not on its own. SPF checks the bounce address (the Return-Path), not the From address people see. A spammer can pass SPF with their own domain and still show your name in From. DMARC closes that gap by requiring the two domains to match.

Check the addresses before you send

SPF tells receivers your mail is really from you. Giggal checks that each address exists, catch-all domains included, so fewer messages bounce. 1,000 free credits.

Free trial Credits never expire Refunds on Unknown