SEO check

SPF Record: What It Is and How to Add or Fix One

Your SEO report flagged a missing SPF record. Learn what it means, how our check works and the one DNS line that turns it green.

Free to use 11 min read Updated Oct 2026

SPF record in one minute: the quick answer

Quick answer: An SPF record is DNS text, published as a TXT record that begins v=spf1, naming the servers allowed to send mail for your domain. Our report passes the check when it finds one. Without it, receiving servers have no published list of your senders to check against, which makes forged mail easier to get through.

  • Pass: Our check found at least one TXT record on the tested host beginning with v=spf.
  • Fail: No such record came back for that exact host, so the report shows a red alert and the How to Fix button.
  • Fix: Publish one TXT record that lists your senders and ends with ~all or -all.

Check my site free

What is an SPF record and how does it work?

SPF stands for Sender Policy Framework, a form of email authentication. The SPF TXT record is plain text in your DNS zone, and RFC 7208 from the IETF says TXT is the only record type to use. The old dedicated SPF type (99) is retired.

A receiving server accepts a message over SMTP, looks up the TXT record for the domain in the MAIL FROM address, and compares the connecting IP address with the authorized mail servers listed there.

The result is pass, fail, softfail, neutral, none (no record found) or an error. A permerror means the record itself is broken, while a temperror is usually a temporary DNS failure.

SPF checks the envelope sender, the Return-Path, and not the From header your reader sees, which is why it is paired with DKIM and DMARC. DKIM signs each message with a key whose public half sits in DNS. DMARC checks that the visible From domain lines up with a passing SPF or DKIM result, and tells receivers what to do when it does not. Publishing a record sends nothing and does not change how your website loads.

Where the record lives in DNS

It sits at the root of the domain, shown as @ in most panels, with a value starting v=spf1. Each subdomain that sends mail needs its own record, because the root record does not cover it.

What a receiving server does with it

The receiver reads the terms from left to right and stops at the first match. If nothing matches and no redirect applies, the result is neutral, so a record should always end with an all term.

Take a message claiming to be from your domain, sent from 198.51.100.7, with the record v=spf1 ip4:203.0.113.10 include:_spf.google.com ~all. That address does not match the ip4 term and is not in the ranges Google publishes, so the receiver reaches the ~all ending and returns softfail. The mail is flagged, not necessarily rejected.

Why a missing SPF record hurts your email and your domain

Start with domain spoofing. Without a record, a receiving server cannot tell your real mail server from a forger who puts your domain in a phishing message. That abuse can damage the domain's reputation and get it listed, which our domain blacklist guide helps you clean up.

Delivery is the second reason. Google's email sender guidelines say every sender needs SPF or DKIM, and bulk senders, more than 5,000 messages a day to Gmail accounts, need SPF, DKIM and DMARC. Both groups are told to keep the Postmaster Tools spam rate under 0.10 percent where you can, and never at or above 0.30 percent.

Google does not list SPF as a ranking factor, so this is an email trust item, not an SEO lever. It sits in the Server and Security group of our report because order emails that land in spam cost you customers.

How SEO Site Checker tests your SPF record

QuestionWhat our report doesWhat you see
What we askOne TXT lookup with the Python dnspython resolver, for the host exactly as you typed it, with no www stripping and no fallback to the root domain.The TXT strings DNS returns for that host.
What passesAny TXT string whose text begins with v=spf, in lowercase with no leading space.A green check, a congratulations line and the record in a green badge.
What failsNo TXT answer, no such domain, or a DNS timeout.A red alert, a line saying the DNS server is not using an SPF record, and the How to Fix button.

The result counts as one check in your score totals, and it never returns a warning.

The exact rule: pass means at least one TXT answer on the tested host starts with v=spf. We do not validate syntax, count lookups, detect multiple SPF records or judge the ending, so a record such as v=spf1 +all still passes.

What a pass and a fail mean here

Green means DNS answered with an SPF looking record for that host, nothing more. A line such as v=spf1 +all turns the check green while authorizing every server on the internet, and two SPF records both pass although receivers reject the pair. Whether your real mail authenticates is outside this test.

The match is also a case sensitive prefix test. A record typed as V=SPF1 fails here, although receivers accept it under RFC 7208, and a malformed start such as v=spf10 would still pass. If the mark stays red on a record you can clearly see, retype the start of it in lowercase as v=spf1 and save again.

Red means no record came back for the host you entered, so check its spelling before you edit DNS.

Edge cases that cause a surprise result

Typing www.example.com tests the www host only. When the record exists only on example.com, the report can show SPF record not found even though mail is fine, as we saw when google.com passed and www.google.com failed. Test the bare domain, or make www a CNAME to the root.

Records over 255 characters are stored as several strings. They still pass, though the badge can show stray quotes at each break.

How to check an SPF record on any domain

  1. Use the free SPF record lookup. Enter the domain in our DNS Record Lookup and find the TXT row that starts with v=spf1. Our guide to finding DNS records for any domain covers other record types.
  2. Use the command line. Run dig +short TXT yourdomain.com on Linux or macOS, or nslookup -type=TXT yourdomain.com on Windows. The quotes in the answer are display only.
  3. Run the report. Read the Server and Security group, where a found record appears in a green badge.

Example output for a Google Workspace domain:

Text
$ dig +short TXT yourdomain.com
"v=spf1 include:_spf.google.com ~all"

One line starting with v=spf1 is what you want to see. Two such lines mean a duplicate, so merge them even though our report would still pass it. No such line means the red result is correct for that host, and you should add a record.

How to add an SPF record to your DNS in five steps

  1. List your sending sources. Write down every service that sends mail as your domain, such as the mailbox host, newsletter tool, store notifications and invoicing, and collect each include value from its help page. Our overview of email hosting providers includes a checklist for updating SPF when mailboxes move.
  2. Build one string. Start with v=spf1, add your include and ip4 terms, and finish with ~all or -all.
  3. Add the TXT record. The name servers in a WHOIS Lookup show where your DNS is hosted. Open that zone editor, add a TXT record for the root domain and paste the string as the value. Most panels add the quotes themselves.
  4. Check for duplicates. Merge any old SPF record into the new string.
  5. Wait, then verify. Google says a change can take up to 48 hours to start working. Check with dig, then re-run the report.
Text
Type: TXT
Host: @
Value: v=spf1 include:_spf.google.com ~all

Cloudflare, GoDaddy and Namecheap accept @ for the root, while cPanel usually wants the full name with a trailing dot in its Name field.

SPF record examples you can copy and adapt

Each block is the TXT value to publish on the host @.

Google Workspace

Google uses the soft ending in its Google Workspace SPF setup guide.

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

Microsoft 365

Microsoft recommends the hard fail ending once DKIM and DMARC are set, per its Microsoft 365 SPF guide.

Text
v=spf1 include:spf.protection.outlook.com -all

Your own server plus a mailing tool

The address below is a documentation address, and ip4 terms cost no lookups. For the mailing tool, copy the include value from that service's own SPF help page and never guess it.

Text
v=spf1 ip4:203.0.113.10 include:mail.example.net ~all

A domain that sends no email

This tells receivers that nothing may send from the domain. It covers only the host it sits on, so subdomains need their own v=spf1 -all, or a wildcard TXT record at *.example.com if your DNS host supports it. A wildcard skips any subdomain that has records of its own.

Text
v=spf1 -all

Replace the example values with your own, and keep one record per host.

SPF record syntax: qualifiers, ~all vs -all and the 10 lookup limit

Terms are read left to right, and the first match decides the result. Most records start with v=spf1 and end with an all term, with your senders in between.

The ip4 and ip6 mechanisms authorize an address or CIDR range directly. To authorize a mailing service, use include, which pulls in the other domain's list. The a and mx mechanisms cover the servers behind your own A or MX records, and the redirect modifier hands the decision to another domain.

Qualifiers and the all term

QualifierNameResult
+PassSender authorized. This is the default.
-FailSender not authorized, and the receiver may reject the message.
~SoftfailSender probably not authorized, so the message is flagged.
?NeutralNo statement either way.

Which ending? Google shows ~all and Microsoft recommends -all once DKIM and DMARC are in place. Use ~all while you audit senders, then -all.

The 10 lookup limit

An SPF check may trigger at most 10 DNS lookups. The include mechanism, the a mechanism, the mx mechanism, the ptr mechanism (avoid it, because RFC 7208 says it should not be published), the exists mechanism and the redirect modifier each count, while ip4, ip6 and the all mechanism cost nothing. Nested includes count too, and RFC 7208 recommends limiting void lookups, which return nothing, to two. The RFC 7208 lookup limits give the exact rule.

Going over the limit gives a permerror (too many DNS lookups), as can the void limit. To cut the count, remove unused services or swap includes for ip4 terms, known as SPF record flattening. It has a cost: when a vendor changes its IP ranges, your copied addresses go stale and its mail fails. RFC 7208 also advises keeping the whole DNS answer under 512 octets.

Common SPF record mistakes and how to fix them

Two records on one host: Receivers that follow RFC 7208 return a permerror when a host has more than one SPF record, so mail can fail although each looks fine alone. Merge them into a single string, and add each new sender to that record instead of publishing another.

  • The wrong host. People often edit one host and run the report against the other, so a correct record looks missing. Test the host you changed.
  • Invalid SPF syntax. Typical slips are include= instead of include:, a trailing dot after an include domain, a space after the colon, or quotes typed into a panel that adds them. Microsoft lists the first three of these as common errors, so write include:domain.com exactly.
  • The wrong ending. A record that finishes with +all authorizes everyone, and one with no all term at all yields a neutral result. Replace +all with ~all or -all, and put an all term last.
  • A forgotten sender. If the newsletter tool is missing from the record, its mail starts landing in the spam folder. Add its include to your record.
  • A CNAME beside TXT. DNS does not allow a CNAME and a TXT record on the same name. Move the mail records to a subdomain.
  • Forwarding surprises. SPF breaks with email forwarding, because the forwarding server is not on your list. DKIM usually survives a forward, so large senders publish it as well, along with DMARC.

How to Fix

The short version, the same steps you see when you click How to Fix in your report.

Why this fails: Our check asked DNS for the TXT records on the host you entered, and none began with v=spf. Your mail may still be delivered, but receiving servers have no published list of your senders to compare against.

How to fix it:

  1. Write down every service that sends mail as your domain, such as your mailbox host, newsletter tool and store notifications, and copy each include value from its help page.
  2. Confirm you tested the right host, because our check reads only the host you type.
  3. Open the DNS zone editor at the company that hosts your DNS, then add a TXT record for the root domain. The host is @ (or blank) in most panels.
  4. Paste the line that matches your setup, from the options below, as the value and save. If you use more than one service, put all their include terms in one line before the ending, and if a v=spf1 record already exists, edit that record instead of adding another. Skip the quotes unless the panel asks.

On Google Workspace the value is:

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

On Microsoft 365 use the hard ending:

Text
v=spf1 include:spf.protection.outlook.com -all

For a domain that never sends mail, publish this to block every sender:

Text
v=spf1 -all

For your own server plus a mailing tool, swap in your address and the include value from that tool's help page:

Text
v=spf1 ip4:203.0.113.10 include:mail.example.net ~all

Cloudflare, GoDaddy and Namecheap accept @ for the root, while cPanel usually wants the full name with a trailing dot (example.com.) in its Name field.

Use ~all while you confirm every sender, then switch to -all, which asks receivers to reject anything else. Google's Google Workspace SPF setup page lists its steps.

Re-test: After the TTL has passed, run this command and confirm exactly one line starting with v=spf1.

Text
dig +short TXT yourdomain.com

Run our free report again on the same address. If the mark stays red on a record you can see, retype its start in lowercase as v=spf1, because our check is case sensitive.

Re-test my website

Frequently Asked Questions

What is an SPF record in simple words?
It is a line of text in your domain DNS that names the servers allowed to send email as you. Receiving servers read it to decide whether a message is genuine. If the record is missing, they have nothing to check the sender against, so forged mail passes more easily.
Why does my SEO report say no SPF record found?
No TXT record on the exact host you tested starts with v=spf. Two causes are common: the record sits on the bare domain while you tested www, or it was never added. Test the bare domain, then confirm with the DNS lookup tool before you change anything.
How do I check my SPF record?
Query the TXT records for the domain with a DNS lookup tool, dig or nslookup, and look for the line that starts with v=spf1. Our SEO report shows the same record in a green badge inside its Server and Security group.
How many SPF records can a domain have?
One per host name. A second record makes receivers return a permanent error, so merge them into a single string. Our check only looks for a record that starts with v=spf, so it will not flag a duplicate. Run dig +short TXT yourdomain.com and see whether two lines start with v=spf1.
What should my SPF record look like?
It starts with v=spf1, lists your senders using include, ip4 or mx terms, and ends with ~all or -all. A domain that uses only Google Workspace would publish v=spf1 include:_spf.google.com ~all, plus one more include for each added service.
What is the difference between ~all and -all in an SPF record?
The tilde is a softfail that marks unlisted senders as suspicious, while the minus is a hard fail that asks receivers to reject them. DMARC treats both as an SPF failure when it evaluates a message. Start with the tilde while you confirm every sender, then move to the minus once the list is complete.
Do SPF records apply to subdomains?
Not automatically. A record on example.com does not cover mail.example.com, so any subdomain that sends mail needs its own record, as both Google and Microsoft state in their guides. Add a separate TXT record for each sending subdomain.
How long does an SPF record take to update?
Usually as long as the record TTL, often minutes to a few hours, although Google says a change can take up to 48 hours to start working. Lower the TTL a day before a planned change.
Is an SPF record enough on its own?
No. SPF checks only the envelope sender, while DKIM signs the message itself. DMARC ties the visible From address to both, and it needs SPF or DKIM to pass and align with that domain before it counts as a pass. Large senders are expected to publish all three.

See how your site scores right now

Paste your address into the free report, then use the How to Fix button on anything that needs work.

Free to use. Results in under a minute for most sites.