i was interested to know how to simply do this. Edit SPF DNS record in all cPanel account's DNS zone files.

I read i have to change serial numbers in DNS zone files too in order to changes take effect.

And here is what i found:

method 1.

cd /var;cp -rp named named.backup_datehere
sed -i "s|spf1 |spf1 valueiwantedtoadd |g" *.db
go to WHM/DNS functions/Set Zone Time To Live (TTL) and select all domains (click first entry, hold shift key and click last entry) change TTL number a bit, example from 3600 to 3610 and apply change. It will change serial numbers in all zones and that is all needed to do

method 2.


method 3.


example script to run it on all accounts once single account test was successfull:
for user in `ls -A /var/cpanel/users` ; do
echo "Working with user $user"
/usr/local/cpanel/bin/spf_installer $user ......
echo "sleep 1" && sleep 1; done