Try free for 14 days

Practice

Checking and setting up SPF correctly: a guide

The SPF record is your domain’s list of senders: it names the servers allowed to send email in your name. If it’s missing or wrong, your emails land in spam more often. This guide shows how to check and fix it.

3 min readHow well is your domain protected? Check my domain for free

Key points at a glance

  • Each domain has exactly one SPF record; it starts with v=spf1.
  • It may trigger at most 10 further DNS lookups, otherwise the check fails.
  • It ends with -all or ~all, never +all.

Step 1: find the record

The SPF record is a TXT record directly on your domain. The quickest way to see it is with our free domain check. In a terminal: on Windows “nslookup -type=txt example.com”, on macOS and Linux “dig txt example.com +short”. Look for the line starting with v=spf1.

Checking SPF in four steps
  1. Find the recordThe domain’s TXT record, starts with v=spf1.
  2. Match sendersAll services that send in your name should be listed.
  3. Check the limitsOne record, at most 10 further lookups.
  4. Check the endingEnds with -all or ~all.

Step 2: list all senders

Think of every service that sends email with your domain: your mailbox provider, the newsletter service, accounting, the online shop or the ticketing system. Each service names the right include entry in its own instructions.

  • Microsoft 365: v=spf1 include:spf.protection.outlook.com -all
  • Google Workspace: v=spf1 include:_spf.google.com ~all
  • Several services: v=spf1 include:spf.protection.outlook.com include:<service> -all
  • Domain without email: v=spf1 -all

Common mistakes

  • Two SPF records on the same domain: this makes SPF invalid. Combine everything into one record.
  • More than 10 lookups: every include, a, mx, exists and redirect counts, including nested ones. Remove services you no longer use.
  • +all at the end: this lets any server in the world send in your name.
  • Outdated ptr: the standard advises against it; replace it with include or ip4.

Add first, then tighten

Only switch to -all once every genuine sender is listed in the record. Otherwise recipients will reject your own emails.

Why SPF alone is not enough

SPF only checks the invisible sender address used for sending, not the sender shown in the mailbox. SPF also often fails on forwarded email. Only together with DKIM and DMARC does SPF effectively protect your domain against forgery.

Frequently asked questions

Should I use -all or ~all?

With DMARC, its policy mainly decides what happens to forgeries. -all is the stricter choice once every sender is listed; ~all is common for the transition period.

How long does it take for a change to take effect?

Usually a few minutes to a few hours, depending on the record’s time to live (TTL).

Do I need SPF on subdomains?

Only on subdomains that send email themselves. Every sending subdomain needs its own SPF record.

How DomainRadar helps

DomainRadar checks your SPF record continuously, counts the DNS lookups, and reports when a sender is missing or the record becomes invalid. In the DMARC reports you can see which services really send in your name.

The domain check stays free. Afterwards you test DomainRadar with all features for 14 days – no credit card, the trial ends on its own.

More guides

Now 14 days free

How does your domain measure up?

DomainRadar continuously checks the SPF, DKIM and DMARC of your domains and tells you in plain words what to do.

Or directly by email: info@domainradar.ch

  • No commitment
  • No credit card
  • Ends on its own after 14 days
Try free for 14 days