How to create an SPF record step by step, with an example
An SPF record defines which servers may send mail on your behalf. Build it yourself in four steps, without running into the DNS lookup limit.
1. List all services
Write down every system that sends mail on your behalf: your own server, the newsletter tool, the shop, the support system, the accounting software. Anything not on the list must not send after the record is in place, so make the list complete.
2. Add the right entries
Most providers give you an entry with include:. For your own servers you use ip4: or ip6: instead.
3. Check the number of lookups
Every include, a, mx, exists and redirect counts as a DNS lookup, including those inside included records. More than ten lookups make the record invalid. Then SPF is treated as if there were no record at all.
4. End with a qualifier
The record ends with ~all (soft fail) or -all (hard fail). Create exactly one SPF record per domain. Two records also make SPF invalid.
An example for two services:
example.com. TXT "v=spf1 include:_spf.google.com include:servers.example.net ~all"
You can build the finished record with the SPF generator. If your record reports an error, the guide how to fix an SPF permerror helps.