DomainRef / Guides

How to fix your SPF record

SPF lists the servers allowed to send mail for your domain. Receivers look it up on the domain in the envelope sender (Return-Path).

1. Publish exactly one SPF record

SPF is a TXT record that starts with v=spf1, published at the exact domain your mail uses as its envelope sender (the Return-Path), which can be a subdomain such as news.example.com. A subdomain does not inherit the parent's SPF, so each name that sends mail needs its own record. Two SPF records on the same name is an error (permerror), so merge them into one.

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

Common includes: Microsoft 365 include:spf.protection.outlook.com, Google Workspace include:_spf.google.com. Your newsletter, CRM or helpdesk provider documents its own. A domain using both Microsoft 365 and Google:

example.com.  TXT  "v=spf1 include:spf.protection.outlook.com include:_spf.google.com -all"

2. Stay within 10 DNS lookups

Each include, a, mx, ptr, exists and redirect costs a lookup, and includes count the lookups inside them too. More than 10 is a permerror and SPF fails for every message. At most 2 of them may return nothing (void lookups). To get back under the limit:

Do not use ptr: the SPF standard (RFC 7208) says not to, and some receivers ignore it.

3. End with -all or ~all, never +all

-all says other servers are not allowed. ~all (softfail) says they are probably not. Once DMARC is at p=quarantine or p=reject, DMARC decides what happens to failing mail, so ~all is fine there. +all lets anyone send as you, and ?all (neutral) says nothing either way, so it gives no protection.

4. Domains that send no mail

parked.example.  TXT  "v=spf1 -all"

Pair it with a DMARC record at p=reject (see the DMARC guide) and, if the domain receives no mail either, a null MX: parked.example. MX 0 .

5. Check what is published

dig +short TXT example.com
Check your domain. The DomainRef check grades SPF (record count, lookup and void-lookup limits, ptr and the all mechanism) with the other mail and domain records in one call, and returns the exact record or step that fixes each problem: GET /v1/domain/check?domain=example.com, $0.01 per domain over x402.