---
title: "DKIM Generator: Create a DKIM Key Pair and Record"
description: "Free DKIM generator. Create an RSA or Ed25519 DKIM key pair in your browser and get the TXT record for <selector>._domainkey. Keys never leave the page."
canonical_url: "https://smtp.dev/tools/dkim-generator/"
---

> Index of every page on this site: [llms.txt](https://smtp.dev/llms.txt)

## 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

```txt
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](https://www.rfc-editor.org/rfc/rfc8463) 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

```bash
# 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.

## Sitemap

See the full [sitemap](https://smtp.dev/sitemap.md) for all pages.
