How to add DKIM records to an existing account(s) on a cPanel server

This article will show examples of how to add DKIM records automatically to an existing customer(s) on your cPanel/WHM server.

Add DKIM record for a single account

/usr/local/cpanel/bin/dkim_keys_install <username>

Add DKIM record to all local accounts

cd /var/cpanel/users
for u in *;do echo "Installing DKIM for user $u"; /usr/local/cpanel/bin/dkim_keys_install $u; done