DKIM Record Generator

Create a DKIM DNS TXT record from a public key PEM, or generate a new RSA key pair in your browser. You get the host name, record value and a zone-file line.

Use the tool

Why this tool exists

DKIM adds a signature to outgoing mail, and receivers check it against a public key published in DNS. Setting it up involves a selector, a correctly formatted v=DKIM1 record, and a key string that often exceeds the 255-character limit for a single DNS string.

Paste the public key your mail system gave you and the tool builds the TXT value with the selector and domain. With no key, it generates an RSA pair using the browser's WebCrypto and shows the private key on the page, so you can configure it in your mail server. Keep that private key secret and never publish it; if you would rather not generate keys in a web page, create them with openssl. Choose 2048 bits or more, since 1024 is considered weak. Nothing is uploaded.

How to use it

  1. Enter the selector and your domain.
  2. Paste a public key PEM, or leave the box empty to generate a new key pair.
  3. Choose the key size, and tick testing mode if you want t=y while you trial it.
  4. Publish the TXT record at the host shown and store any generated private key safely.

Frequently asked questions

Where does the generated private key go?

It is shown on the page only. Copy it into your mail server or signing service and store it securely. If you lose it, generate a new pair and publish a new record.

Which key size should I choose?

2048 bits is the usual choice. 1024 is weak and some receivers distrust it. 4096 is stronger but makes a long DNS record, which some providers handle poorly.

What is the selector?

A label that lets you publish several keys for one domain, for example mail or 2025a. The record goes at selector._domainkey.yourdomain, and the signing server uses the same selector.

Why is the value split into pieces?

A single DNS TXT string is limited to 255 characters. Long keys are split into several quoted strings, which resolvers join together. Many DNS dashboards do this for you.