DKIM public key not found even though it's been in my DNS for a week

January 17, 2018 1.4k views
DNS Email Ubuntu 16.04


I am having problems with my VPS trying to set up Postfix as send-only SMTP server using this tutorial:

Everything has been done the same way as they say in the tutorial and I've followed both of these tutorials as well:

My Zone file has the following information:

$TTL 1800 IN SOA 1516099513 10800 3600 604800 1800 1800 IN NS 1800 IN NS 1800 IN NS 3600 IN A 123.456.789.01 3600 IN AAAA 2b02:c1d0:2:d0::132:3001 3600 IN TXT "v=spf1 mx a ip4:123.456.789.01 ~all" 3600 IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCFqGSIb3DQEBAQUAA4GNADCBiQKBgQCZW8z/5Pvx6xhd2zEPAZNul02xDkb6xEOK1bgmDDypeZ18oOIOZk39WHU4tBoHyJm08e0ddfNtsmWSPyedjnIraOL+cG4lZgr0mAJmK/A1K2i+enoVQFiLitxieEeavtahTrJau5rr5BGqZFwAfwtdbSJOk4DrgexamwBnuaZL0wIGAQAB"

I've replaced the real domain and IPs with fake ones due to we're using a confidential domain at this point. I'm hoping this can be resolved without exposing it.

My mail.txt file inside /etc/opendkim/keys/ looks like this (which was generated during the tutorial for DKIM):

mail._domainkey IN  TXT ( "v=DKIM1; k=rsa; "
      "p=MIGfMA0GCFqGSIb3DQEBAQUAA4GNADCBiQKBgQCZW8z/5Pvx6xhd2zEPAZNul02xDkb6xEOK1bgmDDypeZ18oOIOZk39WHU4tBoHyJm08e0ddfNtsmWSPyedjnIraOL+cG4lZgr0mAJmK/A1K2i+enoVQFiLitxieEeavtahTrJau5rr5BGqZFwAfwtdbSJOk4DrgexamwBnuaZL0wIGAQAB" )  ; ----- DKIM key mail for

Using different DKIM checkers, I get information such as:

DNS query failed for '':NXDOMAIN
A public-key (p=) is required
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;; s=mail; t=1516097701; bh=WBgqksrfs7F0OzQkyE7LiZPHyfFFhl7N4CNav2f5YVw=; h=Date:To:Subject:From:From; b=nlLoX/6Me+yXljyGp2YDsojBYLEq7dgCt1PHcsvD2A5fh76pbWoJsM9kkm6ytn16z
Expected-Body-Hash: WBhgpZjQs7F2OzQkyE7LiZPHyflshl7N4CNav2f5VVw=

DKIM-Result: permerror (no key)

Please note (as title says) that I have had these DNS settings up and running for a week now and the error persists.

What am I missing? I've read all the comments and no one seems to be getting the same error as me. If they did have a similar issue, it was resolved from typos.

Thank you in advance!

1 Answer


Did you ever figure out what was the problem?

Thank you.

Have another answer? Share your knowledge.