DNSfinder.net
Local Key Generation

DKIM Generator

The DKIM Generator creates a signing key pair and formats the public half as a DNS record. Choose a domain, a selector and a key type (RSA at 2048, 1024 or 4096 bits, or Ed25519 where your browser supports it) and you get the TXT record to publish at selector._domainkey.yourdomain plus the private key as PKCS#8 PEM text for the mail server. Both keys are made in your browser with the Web Crypto API. The private key is never sent to our servers.

Loading DKIM Generator...

Querying live edge resolvers and network infrastructure...

How to use the DKIM Generator

  1. Enter the domain you sign mail for and a selector. The box is prefilled with a dated name such as s202610 and accepts letters, digits and hyphens.
  2. Leave Key type on RSA 2048-bit unless you have a reason to change it, then press Generate keys.
  3. Copy Host / Name, Type and Value from the first card into a new TXT record at your DNS host.
  4. Press Download .pem or copy the text box before you leave the page, install the key on the mail server and set the signer to the same selector.

What to look for

The private key stays local

Both keys come from crypto.subtle.generateKey running in your own tab, and pressing Generate keys sends nothing over the network. You can watch the network panel of the developer tools to confirm it. No copy is kept anywhere: reload or close the tab and that private key is gone for good.

RSA 2048 is the default

RFC 8301 tells signers to use RSA keys of at least 2048 bits, and every mainstream receiver verifies them. The 1024-bit option is labelled legacy for software that cannot load anything bigger. Choosing 4096 bits brings up a warning about record length and receivers that stop at 2048.

Long records get split

One TXT string holds at most 255 characters and a 2048-bit record runs to about 400. Most DNS control panels split the value for you. When yours refuses it, the note under the Value field repeats the record as quoted chunks that resolvers join back together.

Guide

Generating a DKIM key pair and putting it to work

What the two halves of the key do

DKIM, defined in RFC 6376, has the sending server sign each message with a private key and attach the result as a DKIM-Signature header. That header names the signing domain in d= and the selector in s=. A receiver joins them into s._domainkey.d, fetches the TXT record there, reads the public key from the p= tag and checks the signature. A match proves the signed headers and the body were not altered after signing.

The pair you generate here therefore goes to two places. The public key is published in DNS for anyone to read, in a record like v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A... The private key goes onto the machine that signs your mail and nowhere else. Whoever holds it can sign mail as your domain, which is why this page creates it in the browser instead of on a server.

Choosing a selector and a key type

The selector is a label you pick. The form suggests s followed by the current year and month, such as s202610: a dated name shows how old a key is and leaves a free name for the next rotation. The field takes up to 63 letters, digits and hyphens and must start with a letter or digit.

Four key types are listed. RSA 2048-bit is marked as recommended. RSA 1024-bit is the smallest size RFC 8301 still permits. RSA 4096-bit produces a public key of about 740 characters, which some DNS hosts cannot store. Ed25519, added to DKIM by RFC 8463, has a public key of only 44 characters, but the option is greyed out when your browser cannot generate that key type.

Publishing the public key in DNS

The first result card has three copyable fields. Host / Name is the full record name, for example s202610._domainkey.example.com. Many DNS panels append the zone themselves, and there you enter only s202610._domainkey. Type is TXT. Value is the record: v=DKIM1, then k=rsa or k=ed25519, then the Base64 public key in p=. Paste it exactly, because one lost character makes the key undecodable and every signature fails.

The domain box is optional: it is not part of the key material and only sets the record name shown and the file name of the download. With a domain entered, a link under the cards opens the DKIM Checker for that selector. Use it once the record is live to confirm the key decodes to the length you chose.

Installing the private key on the mail server

The second card shows the private key as PEM text that begins with -----BEGIN PRIVATE KEY-----, the PKCS#8 container, and Download .pem saves it as selector.domain.private.pem. OpenDKIM and other signers that load keys through OpenSSL read this form directly. If a program insists on the older PKCS#1 layout (BEGIN RSA PRIVATE KEY), convert an RSA key with OpenSSL 3: openssl rsa -in key.pem -traditional -out key-rsa.pem.

Store the file where only the signing daemon can read it. OpenDKIM refuses a key that other accounts can read and logs key data is not secure, so give the file to the opendkim user with mode 600. Point the signer at the file, set its selector to the one you published and its domain to the one in your From address, then reload the service.

Rotating and retiring a key

Selectors make rotation possible without an outage. Generate a new pair under a new selector, publish its record, wait until it resolves, then switch the signer to the new key. Leave the old record in place for several days so mail already in transit still verifies. After that, revoke the old selector by publishing it with an empty p= tag, which RFC 6376 defines as a withdrawn key.

Rotate at once if the private key may have leaked: a backup copied to the wrong place, a server you no longer control, a key pasted into a ticket. A signature also does nothing for DMARC unless d= aligns with the From domain. Send yourself a test message, check for dkim=pass with your own domain in the Email Header Analyzer, then set the policy with the DMARC Generator.

Knowledge Base & FAQ

DKIM Generator FAQs

Common questions about the dkim generator.

Yes, provided the key never leaves your machine, and here it does not. The pair is created by the Web Crypto API built into the browser and no request carries either key to DNSfinder. The page needs HTTPS to do this and reports an error on an insecure connection. Treat the downloaded file like any other secret.