When you have one mail server, you can use the mail server IP in your spf record
client_domain.com. TXT "v=spf1 ip4:10.0.1.1 ~all"
When you have multiple mail servers or multiple IPs on one mail server, you have to do this
client_domain.com. TXT "v=spf1 ip4:10.0.1.1 ip4:10.0.1.2 ip4:10.0.1.3 ip4:10.0.1.4 ip4:10.0.1.5 ~all"
This is not convenient and cumbersome especially when you will adding more servers and migrate client from older server to new one.
To make it simple, you can create one spf record using a subdomain to include all mail server IPs.
client_domain.com. TXT "v=spf1 include:_spf.cpanelcares.com ~all"
To make above record work, you need to add the TXT record like follows to your domain first:
Main spf record which includes all mail servers:
_spf.cpanelcares.com TXT "v=spf1 include:_netblocks1.cpanelcares.com include:_netblocks2.cpanelcares.com ~all"
The _netblocks1 subdomain includes all shared server IPs:
_netblocks.cpanelcares.com TXT "v=spf1 ip4:10.0.1.0/24 ip4:10.0.2.0/24 ~all"
The _netblocks2 subdomain includes all VPS server IPs:
_netblocks2.cpanelcares.com TXT "v=spf1 ip4:126.96.36.199/24 ~all"
PS: Inspired by Google.com’s spf record.
google.com. 3599 IN TXT "v=spf1 include:_spf.google.com ~all"
_spf.google.com. 299 IN TXT "v=spf1 include:_netblocks.google.com include:_netblocks2.google.com include:_netblocks3.google.com ~all"
_netblocks.google.com. 3599 IN TXT "v=spf1 ip4:188.8.131.52/24 ip4:184.108.40.206/19 ip4:220.127.116.11/20 ip4:18.104.22.168/20 ip4:22.214.171.124/18 ip4:126.96.36.199/16 ip4:188.8.131.52/21 ip4:184.108.40.206/16 ip4:220.127.116.11/17 ip4:18.104.22.168/19 ip4:22.214.171.124/19 ~all"