Adding SPF Records and Domainkeys in cPanel

Adding Domain Keys for a Single User

/usr/local/cpanel/bin/dkim_keys_install username

Adding Domain Keys for All Users

for user in `ls /var/cpanel/users`; do /usr/local/cpanel/bin/dkim_keys_install $user; done

Adding SPF Records for a Single User

/usr/local/cpanel/bin/spf_installer username

Adding SPF Records for a All Users

for user in `ls /var/cpanel/users`; do /usr/local/cpanel/bin/spf_installer $user; done

Setup Server to Create DKIM / SPF Records on New Account Creation

vi /scripts/postwwwacct

Add the following at the bottom of the file:

print "\nInstalling DKIM / SPF Records for $name ...";
system("/usr/local/cpanel/bin/dkim_keys_install $name");
system("/usr/local/cpanel/bin/spf_installer $name");

Shell Script for adding SKIM / SPF Records to All Users:

#!/bin/bash
for user in `ls /var/cpanel/users`
do
echo "Installing SPF Record for $user...";
/usr/local/cpanel/bin/spf_installer $user;
echo "Installing DKIM Record for $user...";
/usr/local/cpanel/bin/dkim_keys_install $user;
done


Was this answer helpful?

 Print this Article

Also Read

How to Flush DNS Cache in Windows 10

Flushing the DNS resolver cache can help resolve DNS related problems in Microsoft Windows 10....

How to Clear Your DNS Cache

Overview Your DNS cache stores the locations (IP addresses) of web servers that contain web...

How to Flush DNS Cache

Flushing your DNS cache can be useful when the information about a domain you hold is outdated,...

Install an SSL Certificate Using the AutoInstaller Software in cPanel

This article will describe how to use AutoInstall to install an SSL certificate.The AutoInstall...

How to Edit Zone File and Setup DNS Forwarding

To perform DNS forwarding, change your zone file, (MX, A-Records & CNAME) using the...

Subscribe

We respect your privacy and do not share your information.