I setup dkim record using following tutorial.

But when I check the mx records using googleapps toolbox and dkimcore cheking tool it gives error

google says dkim is not setup, dkimcore says A public-key (p=) is required

All my configuration is same with above document, only different I change my domain name with example.com.

Only different that I see when the guy who write document, when he say sudo opendkim-genkey -s mail -d example.com it returns

"v=DKIM1; k=rsa; p=key"

But when run the exact command it gives me this.

"v=DKIM1; h=sha256; k=rsa" "-p=key" "andAnotherKey"

What may cause this difference ? And how to I solve or how to use ?


I got the exact same issue when i configured DKIM for my server, and from what I remember, you had to generate a DKIM record manually from this command and get a result like :

"v=DKIM1; h=sha256; k=rsa; p=<key><andAnotherKey>"

Example for my own server, i got this result from the command :

mail._domainkey IN      TXT     ( "v=DKIM1; h=sha256; k=rsa; "
      "2Ldmb74nbnIlBZPsi0t9oEyFTtYYJAQrDmudp3/Jr1wftbAh0R4ezCiyqslyukLjwtDpCNPtSvoQOxbkW5hpMhcFiRWfcs4fRd7wbsvhi4eDOynGVz1+0GX/AXthgQFVKF7n6OVQIDAQAB" )  ; ----- DKIM key mail for redheness.net

and i make this record :

v=DKIM1; h=sha256; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4j5eGBPD/BvRQS+kn0WciLGXy1qc/BxQRuE//PSo5JlrvwhNDijBh/ug0T19oyVsGrKuYVd1CuITiVAA5LS80XblcMVrbEWd8cFX1QRpn6zv76BzGW3gTrDs13UMTW3njf3wYWHzY2rWgaiF8GHRr2mqjUQUsqkrYrol7LXrlI1+IvdP/fGUjCYM1wNRJUH0qWMHypSQ6j2Xii2Ldmb74nbnIlBZPsi0t9oEyFTtYYJAQrDmudp3/Jr1wftbAh0R4ezCiyqslyukLjwtDpCNPtSvoQOxbkW5hpMhcFiRWfcs4fRd7wbsvhi4eDOynGVz1+0GX/AXthgQFVKF7n6OVQIDAQAB
                                                                                                                                                                                                                                                                              Start of second key

I can clearly not identify the source of this error and why this command now return this result.

  • Hi redheness, thank you for your reply, may i ask something ? should I change mail.txt or I need to change just dns records ? Mar 6 '19 at 13:37
  • Only DNS record
    – redheness
    Mar 6 '19 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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