SPF record examples

Copy-ready SPF record examples for common setups. Always adapt them to your real senders, keep everything in one record, and check your lookup count before publishing.

Microsoft 365 only

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

Google Workspace only

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

One mail server by IP

v=spf1 ip4:198.51.100.10 -all

Multiple senders (365 + CRM + marketing)

v=spf1 include:spf.protection.outlook.com include:_spf.salesforce.com
       include:servers.mcsv.net ~all

This is where lookups add up fast — verify you’re under 10.

Flattened (IPs only, zero lookups)

v=spf1 ip4:40.92.0.0/15 ip4:40.107.0.0/16 ip4:52.100.0.0/14
       ip4:104.47.0.0/17 -all

Authorizes the same senders with no DNS lookups — but it’s a static snapshot that must be kept current. See SPF flattening.

Macro (single lookup, self-healing)

v=spf1 exists:%{ir}.spf.example.net -all

One lookup, unlimited senders, updated dynamically. See SPF macros.

Subdomain for a bulk sender

mail.example.com  TXT  "v=spf1 include:sendgrid.net -all"

Keeps a bulk sender’s lookups off your root domain’s budget. See the SendGrid guide.

Frequently asked questions

What does a good SPF record look like?
A single record starting with v=spf1, listing only your real senders, ending in -all or ~all, and staying under 10 DNS lookups, e.g. v=spf1 include:spf.protection.outlook.com -all.
What is an example of a flattened SPF record?
A record that lists resolved IP ranges instead of includes, e.g. v=spf1 ip4:40.92.0.0/15 ip4:104.47.0.0/17 -all — zero lookups, but it must be kept up to date.

Test your SPF record now

Build your record from real data — check what your domain currently authorizes.

Test My SPF Records →

Free check · no signup required to see your lookup count.