How to replace existing SPF records in DirectAdmin

Modified on Wed, 13 Oct 2021 at 08:56 PM

If you want to mass change the SPF records, you can run the following command to replace an existing value or to add an extra value to your SPF record.

Add extra settings to the SPF record

If you want to add extra data to the SPF record, make sure that you also add the original_value to the replace_value. Example: if you want to add ip4:127.0.0.1 and the SPF holds ip4:192.168.1.0, than make sure that your replace_value is ip4:127.0.0.1 ip4:192.168.1.0 .

original_value Example: ip4:127.0.0.1
replace_value Example: ip4:192.168.1.0

Make sure that the original_value is unique

Every occurence of the original_value will get replaced with replace_value. Make sure that the original_value only can be found in the SPF records.

Command (replace original_value and replace_value):

cd /var/named
sed -i 's/original_value/replace_value/g' *.db

Don't forget to update the serial numbers. This step is essential when your server uses our DNS cluster.

echo "action=rewrite&value=named" > /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d2000

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article