Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED [CPANEL-20425] DKIM for main server hostname

Discussion in 'E-mail Discussion' started by Mads Nordholm, Jun 7, 2015.

Tags:
  1. Mads Nordholm

    Mads Nordholm Active Member

    Joined:
    Jun 7, 2015
    Messages:
    26
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
    Hi,

    I was trying to set up a DKIM record for my main server hostname today, but that doesn't really seem to be possible through the WHM interface. This post on the feature request board seems to back that theory: https://features.cpanel.net/topic/dkim-for-hostname

    So, does anybody know about a workaround for this issue?

    It must be possible to set this up manually, but I am just not sure which services on the server actually need to be configured for this to work. If anybody could point me in the right direction, I would be very grateful.
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,529
    Likes Received:
    2,181
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    The DKIM record is added in the DNS zone, so you can simply setup the DNS entry through the "Edit a DNS Zone" option in Web Host Manager.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Mads Nordholm

    Mads Nordholm Active Member

    Joined:
    Jun 7, 2015
    Messages:
    26
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
    Thank you. That's great, but how do I generate a valid DKIM entry for the main hostname? For all other domains it's done automatically by cPanel just by ticking a checkbox, but how would I go about doing this for the main hostname?
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,529
    Likes Received:
    2,181
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    You can temporarily add the following entry to /var/cpanel/users/nobody as a workaround:

    Code:
    DNS=hostname.domain.com
    Then, run this command:

    Code:
    /usr/local/cpanel/bin/dkim_keys_install nobody
    Thank you.

    Note: Internal case CPANEL-20425 is open to address an issue where the above workaround is no longer valid as of cPanel & WHM version 70. I'll update this thread with more information on the status of this case as it becomes available.

    Update: This is fixed in in cPanel & WHM version 74.0.9:
    • Fixed case CPANEL-20425: Restore unofficial technique for signing mail from hostname with DKIM
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #4 cPanelMichael, Jun 9, 2015
    Last edited: Oct 1, 2018
    eva2000 and Spork Schivago like this.
  5. max_payne

    max_payne Active Member

    Joined:
    Feb 1, 2013
    Messages:
    33
    Likes Received:
    1
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Wont simply adding a TXT entry in WHM>>Edit DNS Zone (granted you are using your own private nameservers) for the hostname subdomain create a DKIM record for it? So essentially, you would go to the DNS zone file for domain.com and create the following:

    hostname TXT "<dkim record>"

    Please correct me if I am wrong here.
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,529
    Likes Received:
    2,181
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Yes, you can add the zone entry manually if you prefer. However, you must also ensure the key is properly generated, so the workaround is often easier.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. max_payne

    max_payne Active Member

    Joined:
    Feb 1, 2013
    Messages:
    33
    Likes Received:
    1
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Thanks. Although if you need a DKIM record set up for your hostname then you are likely doing things wrong. It is likely a PHP mail sending script that is sending as user or [email protected]. Enable SMTP authentication instead for your mail sending script. If you are running WordPress then enable the 'WP SMTP' plugin to automatically configure all mail sending scripts/plugins to send as a real email address instead of as an address with the hostname specified. This should prevent you from requiring DKIM records for the hostname in the first place.
     
    Spork Schivago likes this.
  8. Mads Nordholm

    Mads Nordholm Active Member

    Joined:
    Jun 7, 2015
    Messages:
    26
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
    Thanks for the input. You are of course right that there should be no DKIM record for the host. I was having an issue with cPanel system emails ending up in my spam folder, and I thought it would be worth a try to add a DKIM record. Turns out my PTR record was wrong, and that fixed the issue for me.

    Thanks for the input in this thread.
     
    ruzbehraja likes this.
  9. nootkan

    nootkan Well-Known Member

    Joined:
    Oct 25, 2006
    Messages:
    128
    Likes Received:
    2
    Trophy Points:
    168
    Michael, when you say temporarily do you mean to remove the DNS=hostname.domain.com line from /var/cpanel/users/nobody after running the /usr/local/cpanel/bin/dkin_keys_install nobody command?
     
  10. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,529
    Likes Received:
    2,181
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Yes, the goal is to simply have the DKIM record generated for the hostname, so you can remove the entry after making the edit.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. allpar

    allpar Well-Known Member

    Joined:
    Sep 16, 2005
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    156
    I got: Cpanel::DnsUtils:608: Empty dns zone host2.domain.com at /usr/local/cpanel/bin/dkim_keys_install line 27, <$socket> line 3.
     
    #11 allpar, May 26, 2016
    Last edited by a moderator: May 27, 2016
  12. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,529
    Likes Received:
    2,181
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Ensure you create a valid DNS zone for your server's hostname first.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,529
    Likes Received:
    2,181
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello Everyone,

    Good news going forward! cPanel & WHM version 78 is tentatively set to include a new Email Deliverability option in Web Host Manager that will allow administrators to more easily detect and solve email delivery issues. Included with this feature is a tool that will check if the DKIM record for the server's hostname exists, and if not, provide an option to automatically add the record (as long as the parent domain resolves to the cPanel server). More information about this feature will be published on cPanel Releases once version 78 is closer to publication.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. ribo

    ribo Well-Known Member

    Joined:
    Oct 15, 2015
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Greece
    cPanel Access Level:
    Root Administrator
    Is cPanel & WHM version 78 with Email Deliverability option will solve email delivery issues(to spam folders) for hotmail and yahoo accounts?
     
  15. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,529
    Likes Received:
    2,181
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi @ribo,

    The feature on it's own won't prevent email delivery issues to remote mail providers such as Hotmail or Yahoo. However, what it will do is make it easier to detect and implement the changes that are often required to ensure email delivery to remote mail servers succeeds.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. The Old Man

    The Old Man Active Member

    Joined:
    Feb 24, 2016
    Messages:
    27
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Thanks for this, much appreciated.

    I've been setting up SPF, DKIM and DMarc for my virtual hosts (all work great except for when my forums send email via Sparkpost and they always fail the SPF check! Grr), and I noticed a lot of cPanel notifications sent from my VPS to my off-server personal Gmail address were being marked as spam 550-5.7.1 by Gmail and so came here looking for a fix.

    "Why is this message in Spam? It seems to be a fake "bounce" reply to a message that you didn't actually send.

    I see from my WHM that 78.0.11 is available to install, so hopefully this will fix the issue.
     
    cPanelMichael likes this.
  17. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,529
    Likes Received:
    2,181
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Keep in mind the upgrade to cPanel & WHM version 78 itself isn't what will reduce the chance of SPAM blacklisting. It simply makes it easier for administrators and cPanel users to enable the options (e.g. DKIM, SPF) that are often required to ensure email delivery to remote mail servers succeeds.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    The Old Man likes this.
  18. The Old Man

    The Old Man Active Member

    Joined:
    Feb 24, 2016
    Messages:
    27
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Thanks, understood.

    Will have to put this on hold for now. My upgrade stopped after updating the upgrade page after 20 minutes and now I can't access my WHM at all. My websites appear to still be live though.

    Aha, another few minutes and WHM is alive, responding and telling me I need to reboot my server to complete the upgrade. Thank heavens!
     
    #18 The Old Man, Feb 21, 2019
    Last edited: Feb 21, 2019
  19. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,529
    Likes Received:
    2,181
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Feel free to open a support ticket if you'd like us to help troubleshoot why that happened and make sure the update succeeds on the next attempt.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice