Guide
What is SPF?
SPF (Sender Policy Framework) is a DNS record that lists which servers may send email for your domain. A receiving server checks the sending server against the list.
What an SPF record looks like
example.co.uk TXT "v=spf1 include:spf.protection.outlook.com -all"
v=spf1marks it as SPF.include:adds another provider's servers, here Microsoft 365.ip4:andip6:allow specific addresses.-allmeans anything not listed should fail.~allis a softer "probably not allowed".
The rules to remember
- One record only. Two SPF records make SPF fail. Merge new services into the existing record.
- Maximum 10 DNS lookups. Over that, SPF returns an error. See fixing too many lookups.
- It checks the envelope sender, not the From address people see, which is why DMARC alignment matters.
- It breaks on forwarding, so pair it with DKIM.
Domains that send no email
Publish v=spf1 -all on every parked or unused domain so nobody can send as it.
See how DMARC uses SPF, or run the free check on your domain.
Common questions
Should I use -all or ~all?
~all is fine while you are still finding senders. Once DMARC is at quarantine or reject, -all is the cleaner end state.
Can I have more than one SPF record?
No. A domain must publish exactly one SPF record.