Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 20 servers hosted on orderbox DNS hosting,I have set up opendkim on all servers with signing by domain say "" i.e in DKIM header of all the server outbound mails. The public key generated by all the servers is different,

but i want the public key to be same in all the servers so that i get dkim="pass" by entering the universal public key in the DNS hosting TXT record entry.

My server's are using centos5 ad postfix as MTA.

share|improve this question

This depends on how you set the DKIM signing, but the idea is:

DKIM requires a public and private key. The private key should be saved in a safe location on your server. The public key will used in the DNS TXT record for DKIM.

You generate two keys - one private and one private: openssl genrsa -out rsa.private 1024 and public: openssl rsa -in rsa.private -out rsa.public -pubout -outform PEM

Now save your private key to the dkim directory, where you configured Postfix or OpenDKIM to look it up. Distribute this private key on ALL 20 servers, and they will sign the mail the same way. And make the respective DNS TXT entries for the "public".

share|improve this answer
i followed this tutorial… for configuring opendkim in postfix i have generated private and public keys on 1 server.Now are you saying to use this public key and private key on all servers after configuring opendkim in them i.e using public key in TXT recoeds and saving private and public key on say "cat /etc/opendkim/keys/" and "cat /etc/opendkim/keys/" respectively? – achal tomar Aug 20 '12 at 7:25
The private is the one which signes the emails, so you ned just that. So just copy this file /etc/opendkim/keys/ (path taken from the tutorial) and copy this file to all servers. Set upt DNS TXT the right way (test it once on the working server) and you are good to go – leviathanus Aug 20 '12 at 18:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.