Search Our Database

How to setup DKIM using DirectAdmin

Last updated on |
by

Step 1 – update DirectAdmin

Before you can set up DKIM records for your domains you need to update your DirectAdmin to the latest version. This can be done by click on “Licensing/Updated”.

After that click “Update DirectAdmin” button at the bottom of the page, see the image below:

Configure directAdmin in Linux to support DKIM

First, you will have to edit “directadmin.conf” file and add line “dkim=1”.

go to directory

vi /usr/local/directadmin/conf/directadmin.conf

Step 3 – enable DKIM record set for domains

To setup DKIM record for each new domain, you need to ensure it is an active domain

Run the following command

 cd /usr/local/directadmin/scripts - enter the directory where DirectAdmin scripts are located 
./dkim_create.sh domainame.com - run the DKIM record creation script for the existing domain

After running the script DirectAdmin will automatically add DKIM records for all new domains. DKIM records can be found in your DirectAdmin users DNS Management section, see the image below:

The record itself should look something like this:

Step 4 – edit your Exim configurations

Note: For shared hosting does not need to follow step 4

First, go to file

 /etc/exim.conf

After that find the line that contains text “remote_smtp” and add the following information:

*********************************************************************************
remote_smtp:
   driver = smtp
   dkim_domain = $sender_address_domain
   dkim_selector = x
   dkim_private_key = ${if exists{/etc/virtual/$sender_address_domain/dkim.private.key}{/etc/virtual/$sender_address_domain/dkim.private.key}{0}}
   dkim_canon = relaxed
   dkim_strict = 0
***********************************************************************************

The data in the file should look something like this:

Save the file and restart Exim using following command:

    service exim restart

Step 5: Add dkim in a record

Need to add manually the Dkim record in DNS management record as below:

Completed!