How do I check if my SPF record is valid?

Still have a question, spotted an error, or have a better explanation or a source we should cite?

A valid SPF record has to clear a handful of very specific checks: exactly one record, correct syntax, under the 10-lookup cap, and an "all" qualifier that makes sense for your setup. Miss any one of them and receivers will either fail SPF or throw a permerror.

You've got two ways to check. One takes 10 seconds. The other takes a couple of minutes and shows you more.

The 10-second version: paste it into a checker

Drop your domain into our SPF checker. It'll tell you:

  • Whether you have exactly one SPF record (more than one is a permerror)
  • Whether it starts with v=spf1
  • How many DNS lookups it triggers (has to stay under 10)
  • Which mechanisms are there and whether each one resolves cleanly
  • What "all" qualifier you're publishing (-all, ~all, or ?all)

If any of those show red, the checker tells you what to fix. This is how most people should do it.

The command line version: dig

If you live in a terminal, you can query DNS yourself:

dig TXT yourdomain.com +short

Look for the line that starts with "v=spf1". That's your SPF record. Things to verify:

  • Exactly one v=spf1 line. If you see two, consolidate them immediately. Two records is an automatic permerror.
  • Syntax is right. Mechanisms should be include:, a, mx, ip4:, ip6:, exists:, ptr, separated by spaces.
  • Ends with an all mechanism. -all for production, ~all while you're auditing, ?all almost never.

What "valid" looks like

And a clean production SPF for a domain using Google Workspace and one ESP might look like:

v=spf1 include:_spf.google.com include:_spf.yourESP.com -all

Short. One record. Under 10 lookups. Hard fail at the end. That's the shape you want.

If the checker flags something and you're not sure how to interpret the result, the SOS hotline is free.

Contributors

Who worked on this answer

Every name links to their profile. Every company links to their site. Real people, real accountability.

Ask an AI · tailored to your setup

Validate My SPF Record

I just read the Email Almanac entry on checking SPF validity. Help me walk through my domain's SPF record and confirm it's valid, clean, and production-ready. Walk me through: 1. Whether I have exactly one SPF record on my domain 2. Whether my lookup count is under 10 3. Whether my "all" qualifier matches my stage (auditing vs production) 4. Any syntax or resolution issues I should fix --- My details (fill in what applies): - Sending domain: your domain - Current SPF record (paste if you have it): paste here - Or my SPF lookup count from a checker: number or unsure - Known sending providers: ESPs, Google Workspace, Microsoft 365, etc. - What prompted the check: [setting up fresh / troubleshooting delivery / auditing / other]

Edit the yellow boxes, then send to the AI of your choice.