Add ipv6 to spf bulk
AnsweredI wan to add in bulk an spf record: +ip6:xxxxxxxx
Reset the dns zone for the clients doenst work. People have their own customized SPF. that need to stay the same.
Also use the spf installer is not possible its for a specific user. so doing it for each user is not possible.
i have over 300 users/domains.
please some any idea/workaround/script?
-
Aaah i see it!
Excellent solution. I have fixed it. Thank you again. Lifesaver!
1 -
Hey there! Unfortunately I don't have any such tool available. When this question has come up in the past (https://support.cpanel.net/hc/en-us/community/posts/19129342635799-Bulk-Edit-SPF) we've recommended careful scripting of the affected domains in order to achieve this. I'm sorry I don't have more useful details.
0 -
Have all the records got something in common - such as ip4:xx.xx.xx.xx ? If so, a regular expression can be easily made to "key off" of that entry and append additional entries after it? If it doesn't, a regular expression can still be written but will be a bit more tricky..
0 -
he guys!
Thanks for the reply rbairwell i want to add the following. ip6:*******
Now the record is:
v=spf1 a mx ip4:*** include:****** -all
it need to be:
v=spf1 a mx ip4:*****ip6:***** include:****** -allBut iwhout changing the rest of the spf (people have their own spf policy added, so that need to be unchanged. so jus tadding an ip6:**** to all users..
Thanks again!
0 -
Try the following:
cp -rf /var/named{,.backup}
find /var/named/*.db -exec perl -pi -e "s/(\Qip4:192.168.1.0\E) ?/$1 ip6:2001:db8:abcd:ef01:2345:6789:0abc:def /g" '{}' \;
find /var/named/*.db -mtime -1 -exec perl -pi -e 'if (/^\s+(\d{10})\s+;\s?(?i)serial/i) { my $i = $1+1; s/$1/$i/;}' '{}' \;
/scripts/restartsrv_named
which should replace any occurrences of the text ip4:192.168.1.0 with itself (the $1) and followed by the text ip6:2001:db8:abcd:ef01:2345:6789:0abc:def . If anything goes wrong, then backups should be available in /var/named ending in .backup .0 -
hi rbairwell that replaces the ip4. instead of leaving that one alone and just add the ipv6. I very appreciate how you think with me. Thank you so much! i hope you can help me with the code!
0 -
I have the solution with this one:
But it changes all my hard fail (-all) to soft fail (~all) :( I nead to have it stay hard fail.
0 -
If you run:
/usr/local/cpanel/bin/spf_installer --helpyou see that you can use <is-complete>, i.e. in your case 1
0 -
hi already tried. but its deleting the other spf records. and it is not in bulk.
0 -
hi rbairwell that replaces the ip4. instead of leaving that one alone and just add the ipv6. I very appreciate how you think with me. Thank you so much! i hope you can help me with the code!
It shouldn't replace the IPv4. I've just done a quick test:
# perl -e 'my $spf="example ip4:192.168.1.0 spf";print "$spf\n";$spf=~s/(\Qip4:192.168.1.0\E) ?/$1 ip6:2001:db8:abcd:ef0
1:2345:6789:0abc:def /g;print "$spf\n";'
example ip4:192.168.1.0 spf
example ip4:192.168.1.0 ip6:2001:db8:abcd:ef01:2345:6789:0abc:def spfand as you can see, the regular expression took the string "example ip4:192.168.1.0 spf" and changed it to "example ip4:192.168.1.0 ip6:2001:db8:abcd:ef01:2345:6789:0abc:def spf" (keeping the bits before the IPv4 address, the IPv4 address and the bits after - just inserting the ip6 bit in the middle).
0
Please sign in to leave a comment.
Comments
10 comments