How to get the DKIM public key from Plesk if DNS is not installed

Created:

2017-06-06 17:43:25 UTC

Modified:

2017-08-16 15:45:12 UTC

1

Was this article helpful?


Have more questions?

Submit a request

How to get the DKIM public key from Plesk if DNS is not installed

Applicable to:

  • Plesk Onyx for Linux

Question

Signing for outgoing emails is enabled. How to get the DKIM public key from Plesk if an external DNS is used and local DNS is not installed?

Answer

The only way to get the public key is to recreate it with openssl from a private one. Private keys are located in the corresponding domain directory in /etc/domainkeys/ , for example, /etc/domainkeys/example.com/default (for selector "default")

To recreate a public key from a private, run the following:

# openssl rsa -in /etc/domainkeys/example.com/default -pubout -out public.key

The file will look like:

# cat public.key
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+aOU9Dw2Qedi6qOEcpbGQ3pHV
I8SonKGNSBBgiImChx6k6I7s1UqeCzaHpKXKLIY4GA601gloVCnnTumZ/5TxnviB
Hg1a2lsatt/gCj2pl61a+uALM1oRdgPhxPYefloFpi0lau8thV6u9BYTfUgfqIF+
dvFIVlu0MULsWDDJfwIDAQAB
-----END PUBLIC KEY-----

Then, merge the result into one string.

Copy the data of the public key file into TXT record for the domain to add it on external DNS server.

default._domainkey.example.com IN TXT "v=DKIM1;k=rsa;
p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+aOU9Dw2Qedi6qOEcpbGQ3pHVI8SonKGNSBBgiImChx6k6I7s1Uqe
Have more questions? Submit a request
Please sign in to leave a comment.