GoAdmio

dkim

Add a DKIM TXT record to a domain's Cloudflare DNS (auto-generated or custom value)

On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also


Overview

/go/dkim is a short wrapper around cloudflare. It adds the DKIM TXT record that lets receiving mail servers verify messages sent from your domain. It can:

The call is appended to /var/log/go/dkim.log.


Quick start

# Add the auto-generated DKIM record for a domain
/go/dkim example.com

Syntax

/go/dkim <domain> [value]
Form Runs Behavior
/go/dkim <domain> cloudflare --domain <domain> --type dkim Adds a DKIM record with an auto-generated value.
/go/dkim <domain> <value> cloudflare --domain <domain> --type txt --name <domain> --value <value> Adds a TXT record with your value. See the note below.

[!WARNING] In the two-argument form the record name is the domain itself, not a DKIM selector name. The record is created at <domain>, not at <selector>._domainkey.<domain>, so mail servers will not find it as a DKIM key. To publish a custom DKIM value at the right name, use txt with the full record name.


Options

dkim takes positional arguments only.

Argument Required Notes
<domain> Yes The full domain name, as hosted on Cloudflare.
[value] No The record value. Switches to the custom TXT form.

The arguments are passed to cloudflare without quotes, so a value containing spaces (such as v=DKIM1; k=rsa; p=...) is split into several arguments and may be rejected or truncated.


Output

dkim prints nothing itself. Any result or error message comes from cloudflare.


Examples

# Auto-generated DKIM record
/go/dkim example.com
# Custom value (value without spaces; see the notes above first)
/go/dkim example.com 'k=rsa;p=<public-key>'

Troubleshooting

Symptom Likely cause Fix
No record appears in Cloudflare The domain isn't on Cloudflare, or the API credentials aren't set up. Add the domain with dns and configure cloudflare.
Custom record is at the domain root The two-argument form uses the domain as the record name. Use txt with the full <selector>._domainkey.<domain> name.
Custom value is cut off or rejected The value contains spaces and is split into several arguments. Use the auto-generated form, or txt.
Mail still fails DKIM checks DNS hasn't propagated, or the signing service isn't set up. Check the record with checkdkim and install signing with installdkim.

Details

dkim does no validation of its own. With no <domain>, it passes an empty value on to cloudflare. Account creation already generates a DKIM key for each new domain (see create); dkim is how you publish the matching DNS record.

Companion commands add the other email authentication records: spf and dmarc.


See also

Command Description
cloudflare Manage DNS records using Cloudflare's API
txt Add a TXT record to a domain through Cloudflare
spf Add or refresh the SPF TXT record via Cloudflare
dmarc Add a DMARC TXT record in Cloudflare (auto-generated or custom value)
checkdkim Check if a DKIM record is valid in GoAdmio
installdkim Install and configure OpenDKIM
dns Add your domain to Cloudflare and edit the DNS zone