Besides include and all, SPF can list servers by address (ip4, ip6), by the addresses of a name (a), by your mail servers (mx), by reverse DNS (ptr) or by a DNS test (exists). Only ip4 and ip6 are free.
| Syntax | ip4:<net> ip6:<net> a mx ptr exists:<domain> |
| Free (no lookup) | ip4, ip6 |
| One lookup each | a, mx, exists (mx up to 10 names) |
| Should not be used | ptr |
| Defined in | RFC 7208 §5 |
What it does
ip4 and ip6 match an address or a range, written as CIDR (203.0.113.0/24). a matches the addresses of the domain (or a named host); mx matches the addresses of the domain’s mail servers — the ones that receive mail, which are not always the ones that send it.
ptr matches by reverse DNS. The specification says it should not be used: it is slow, unreliable and heavy on the receiver. exists matches when a name exists, and is mostly used with macros by services building records dynamically.
Examples
v=spf1 ip4:203.0.113.10 ip4:198.51.100.0/28 ip6:2001:db8::/48 ~all
Addresses only: no lookups at all.
v=spf1 a mx ~all
The domain’s own web and mail server addresses — two lookups, and only useful if those servers send mail.
See what your own SPF record says
Every term of your published record, read and explained — including this one.
Common mistakes
- a and mx on domains whose web or inbound mail servers never send.
- ptr, which many receivers treat as a warning sign.
- Broad ranges (a /16 or wider) that authorise far more than your servers — Gmail calls these “suspicious entries”.
What we recommend
Prefer ip4 and ip6 for your own servers and include for services. Drop ptr.
Read what each term of your record authorises →
Sources
Checked on 25 September 2026 against these official sources: