cPanel and DKIM / SPF

edited March 2018 in Help
Go easy -- new to all this.

I have a number (3) of domains on a Centos instance running WHM/cPanel. (My main reason for using cPanel is that I didn't want to have to set up and administer a mail server.)

Am having trouble with emails getting through to Gmail addresses. I have read a number of articles here and elsewhere on setting up DNS records for DKIM and SPF, but must be doing something wrong, cause it ain't working.

Can someone clarify how the DNS settings on Vultr's own control panel/settings interacts with cPanel's/WHM's settings?


  • OK, so I think I figured this out. Seems the issue might be that the DKIM string generated by cPanel sometimes is slightly differently formatted to how the TXT record for Vultr's DNS control panel likes it. If someone else is trying to setup DKIM and also using WHM/cPanel, this might be worth trying:

    This assumes you've already Enabled DKIM/SPF Globally via WHM (DNS Functions > Enable DKIM/SPF Globally.

    Log into WHM
    Click on DNS Functions > Edit DNS Zone
    Copy the DKIM key string from the default._domainkey field
    Paste it into a plain text editor, turn off text wrap, and remove any characters spaces form the "p= ..." string forwards. Also delete the trailing /;
    Add a quote mark to the end of the string (so that the entire string is enclosed in quote marks -- "v=DKIM1...p=...."
    Copy and paste the newly formatted key string into Vultr's DNS control panel as a TXT record.

    That's what worked for me.
  • Just to add to redkev post.
    Once you removed all the characters you can test the key using this tool.
    Just copy and paste everything from v=DKIM1; k=...; p=...
    If the key is not valid you removed too much from it or not enough .
    My key was actually split in 2 .. i had "v=DKIM1; k=...; p=..." then a space and the rest of the p key which is due to a limitation some DNS servers have a txt size of max 255 characters like this ( "part one" part2\; ).
    To make a valid key I had to remove all the double quotes, the space that separated the p and the \; at the end .
    In vultr DNS you need to put again double quotes around the whole key when you add it for your domain.
    Hope this helps.
Sign In or Register to comment.