checkdkim
Check whether each domain's DKIM DNS record exists and matches the DKIM key on this server
- Command:
/go/checkdkim - Category: Email
- Required option: None
- Output:
<domain> DKIM: Pass,Invalid, orNone - Last updated: 2026-11-20
On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also
Overview
DKIM signs outgoing mail so that other servers can confirm it really came from your domain. Mail is signed with a private key on this server, and the matching public key must be published in the domain's DNS. /go/checkdkim verifies that this is set up correctly. It checks:
- that the DKIM key on this server is valid for the domain
- that the public key in DNS is the same as the public key on this server
You can check one domain or every hosted domain.
Quick start
# Check one domain
/go/checkdkim example.com
# Check every hosted domain
/go/checkdkim
Syntax
/go/checkdkim [domain]
If you run it without root, it re-runs itself with sudo.
Options
| Argument | What it does |
|---|---|
<domain> |
Checks that domain. |
| (none) | Checks every domain in /home that has a www folder, and prints a line of dashes after each one. |
A domain without a /home/<domain>/www folder prints nothing. The DKIM selector is always dkim, so the DNS name checked is dkim._domainkey.<domain>.
Output
The command prints one line for each domain:
| Result | Meaning |
|---|---|
example.com DKIM: Pass |
The key test succeeded and the public key in DNS matches the one on this server. |
example.com DKIM: Invalid |
The key test succeeded, but the public key in DNS is different from the one on this server. |
example.com DKIM: None |
The key test did not succeed. The DNS record is missing, cannot be read, or does not match the private key. |
Each run also adds a line to /var/log/go/checkdkim.log.
Examples
# One domain
/go/checkdkim example.com
example.com DKIM: Pass
# Show only the domains that have a problem
/go/checkdkim | grep -E 'None|Invalid'
# Look at the DNS record yourself
dig TXT dkim._domainkey.example.com +short
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
DKIM: None for a new domain |
No DKIM key was created, or the DNS record is not published yet. | Create the key with installdkim, publish the record with dkim, and wait for DNS to update. |
DKIM: None for an older domain |
The DNS record was removed, or the domain now uses other nameservers. | Check the nameservers, then publish the record again with dkim. |
DKIM: Invalid |
The DNS record holds an old key, for example after the key was regenerated. | Replace the DNS record with the current key, using dkim. |
| Result does not change after a DNS update | The resolver on this server is still using the old answer. | Wait for the TTL to pass, then run the command again. |
| Nothing is printed for a domain | The domain has no /home/<domain>/www folder. |
Check the domain name. |
command not found |
opendkim-testkey or dig is not installed. |
Install OpenDKIM with installdkim, and the DNS tools (dnsutils). |
Details
How the check works
For each domain, the command:
- Runs
opendkim-testkeyfor the domain with the selectordkim. If the result does not containOK, it printsNone. - Reads the public key (
p=) from/etc/opendkim/<domain>/dkim.txt. - Reads the public key (
p=) from the DNS TXT recorddkim._domainkey.<domain>withdig. - Prints
Passif the two keys are the same, andInvalidif not.
Known issues
- A DKIM key in DNS is often stored as several quoted pieces. The comparison reads only the first piece of the key on each side, so a difference at the end of a long key is not detected.
- The selector
dkimcannot be changed, so records with another selector are reported asNone. - When run for all domains, the command ends with status
1. - The command checks DKIM only. For other mail records, see
spfanddmarc.
See also
| Command | Description |
|---|---|
dkim |
Add a DKIM TXT record in Cloudflare (auto-generated or custom value) |
installdkim |
Install and configure OpenDKIM |
dmarc |
Add a DMARC TXT record in Cloudflare (auto-generated or custom value) |
spf |
Add or refresh the SPF TXT record via Cloudflare |
troubleshoot |
Troubleshoot email problems in GoAdmio |
reversedns |
Check reverse DNS (rDNS) in GoAdmio |