Generator

DKIM key generator

Pick a selector and key type, and the DKIM generator creates a key pair with WebCrypto in your browser. You get the TXT record to publish and the private key for your mail server. Nothing is sent to a server.
Any name. A date-based one makes rotation easy.

Recommended. Works everywhere.

Only for DNS hosts that cannot store longer TXT records.

Large record; some DNS hosts and verifiers struggle with it.

Short key (RFC 8463). Sign with RSA too; many verifiers ignore it.

Generated in your browser
The key pair is created with WebCrypto on this page and never sent anywhere. For production, generating the key on the server that signs means the private key never has to be copied.

Pick a key type and generate. The TXT record and the private key appear here.

How to use the DKIM generator

  1. Enter your domain and a selector. A date-based selector such as s2026 makes rotation obvious.
  2. Pick a key type. RSA 2048 is right for almost everyone.
  3. Generate. Publish the TXT record at <selector>._domainkey.<domain>.
  4. Install the private key on the signing server and keep it out of version control.
  5. Send a test message and check that Authentication-Results shows dkim=pass header.d=yourdomain and header.s= with your selector.

What the record looks like

s2026._domainkey.example.com.  TXT  "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."

The p= value is the public key in SubjectPublicKeyInfo form, base64 encoded. For Ed25519 it is the raw 32-byte key, as RFC 8463 specifies.

A 2048-bit key does not fit in a single 255-character TXT string. Most DNS panels split it for you. If yours does not, or you edit zone files directly, use the split version the generator shows. The strings are joined without spaces.

Using the key with OpenDKIM

# Paste the private key the generator shows into the key file
sudo mkdir -p /etc/opendkim/keys/example.com
sudo nano /etc/opendkim/keys/example.com/s2026.private
sudo chown opendkim:opendkim /etc/opendkim/keys/example.com/s2026.private
sudo chmod 600 /etc/opendkim/keys/example.com/s2026.private

# /etc/opendkim/KeyTable
s2026._domainkey.example.com example.com:s2026:/etc/opendkim/keys/example.com/s2026.private

# /etc/opendkim/SigningTable
*@example.com s2026._domainkey.example.com

The generator outputs PKCS#8 PEM (BEGIN PRIVATE KEY), which OpenDKIM, Rspamd and most libraries such as Nodemailer accept.

Security notes

Keys are generated with the browser's WebCrypto API and never leave the page. Even so, a key that has been displayed on screen and copied around is less private than one generated on the signing server with opendkim-genkey or openssl. Use this generator for prototypes, test domains and servers where that trade-off is fine.

Frequently asked questions

DKIM Lookup
Fetch a DKIM key by selector, read its size and flags, or scan common selectors.
SPF Record Generator
Build an SPF record from your mail providers and see the lookup cost as you go.
DMARC Record Generator
Pick a policy, reporting address and alignment, and copy a valid DMARC record.