DKIM recipe with 3rd party / external DNS

xyloweb

Registered
Sep 16, 2012
3
1
3
cPanel Access Level
Root Administrator
It took me a long time to figure out all the steps involved, so here is what you need to do.

1) Turn on DKIM signing in your outgoing messages by going to WHM, Acount Functions, Modify an Account. Edit your account by clicking "Enable DKIM on this account". Alternatively, turn on DKIM on CPanel - Email Authentication for your web site. (Ignore the fact that it only talks about DKIM for incoming mail.)
2) Figure out your DKIM public key using one of these methods:
a. The easiest way (if it works) is to find this info in CPanel - Email Authentication. If you see " Enabled & Active (DNS Check Passed)", then go on to the next method. Otherwise, you should see a long TXT record including your public DKIM key.
b. At the WHM, go to Main >> DNS Functions >> Edit DNS Zone for your domain, and find the TXT record for DKIM there.
c. Otherwise, log on to your server with Putty (or similar terminal program) for the next two steps: Figure out your DKIM Selector (e.g. 'default') by typing: grep dkim_selector /etc/exim.conf , then find out your server's DKIM public key by going to /var/cpanel/domain_keys/public/ Type "more mywebsite.com" to see the public key. Copy the public key, not including the BEGIN/END lines.
3) Go to your nameserver (perhaps with your Domain Registrar), and insert a TXT record for "default._domainkey.mywebsite.com" (use your DKIM Selector here), with a value of "v=DKIM1; g=*; k=rsa; p=PublicDomainKeyGoesHere"
4) You can send email via (a) a dedicated account, (b) sent via a web page on mywebsite.com (e.g. by PHP), or (c) an alias, using "mywebsite.com" as the From address (e.g. the actual mail account is using myotherwebsite.com, but "From" is set to [email protected]). IMPORTANT: Any email you send must have the domain name in lower case. (I believe this is a CPanel bug that they are aware of.)
5) Test it by sending an email to [email protected]. You will get a return email telling you whether the email passed several tests.
 
  • Like
Reactions: oviliz

fahedksa

Member
Jun 2, 2004
5
0
151
Hi,
Thank you for your post but i have a qustion regarding point 3:
Should i do these in hosting server or domain registerar?
 

xyloweb

Registered
Sep 16, 2012
3
1
3
cPanel Access Level
Root Administrator
Hi,
Thank you for your post but i have a qustion regarding point 3:
Should i do these in hosting server or domain registerar?
The answer could be either (or even some other server), depending on who controls your DNS entries.
Your domain registrar will control what DNS servers your web site uses. Call and ask them if you're not sure.
Then you need to edit the TXT records on that DNS server.

For me, I use my domain registrar for DNS, even though my web server could act as a DNS server. So, for example, I could enter TXT records on my web server, but they would have no effect, since only the DNS records at my domain registrar are being used by anyone.