DKIM Generator - Free DKIM Record Generator

Easily create a valid DKIM record for your domain with our free DKIM generator. Strengthen email authentication and secure your messages from spoofing


A DKIM generator creates the RSA key pair a mail server uses to sign outgoing email, plus the DNS TXT record that publishes the public key. Enter your domain and a selector, choose a key length, and the tool generates everything with your browser's Web Crypto API. The private key is created on your device and never sent to PagesTest.

Do you need to generate your own DKIM key?

Usually not. Hosted email and sending services (Google Workspace, Microsoft 365, Mailchimp, SendGrid, Amazon SES and others) generate DKIM keys for you and show the record to publish. Use this generator when you run the signing server, for example Postfix with OpenDKIM or rspamd, or an application that signs mail itself.

How to set up DKIM with the generated keys

  1. Enter your domain and a selector: any short label, such as mail or a date like 202610. Using a new selector for each key makes rotation easy.
  2. Choose 2048 bits unless your DNS provider can't store a long TXT record. Click Generate.
  3. Publish the Record Value as a TXT record at the name shown (selector._domainkey.example.com). Many DNS panels want only selector._domainkey as the host name.
  4. Install the Private Key (PKCS#8 PEM format) in your mail server's DKIM signing configuration and keep it secret. Anyone with it can sign mail as your domain.
  5. Confirm the record is live with the DKIM Lookup, then send a test message and check that the receiving server reports dkim=pass in its headers.

Understanding the output

  • Record Value: v=DKIM1; k=rsa; p=…, where p is the public key in Base64. This goes in DNS.
  • Private Key: the signing key for your mail server. Store it like a password.
  • Public Key: the same public key in PEM format, which some software asks for instead of the DNS record value.

Common setup problems

  • Record too long for the DNS panel. A 2048-bit key exceeds 255 characters, so it must be stored as several quoted strings. Most DNS providers split it automatically; with zone files, split it yourself without adding spaces inside the key.
  • Selector mismatch. The selector in the mail server's configuration must exactly match the one in the DNS name.
  • DMARC still failing. The signing domain (d=) must match the From address domain for DMARC alignment. Check the policy with the DMARC Lookup.

Frequently asked questions

Is it safe to generate a DKIM private key in a browser?

The key is generated by your browser's Web Crypto API and stays on your device. Clear the output after copying it, and generate keys on a device you trust. If you prefer, the equivalent with OpenSSL is openssl genrsa -out dkim.key 2048.

What key length should I choose?

2048 bits. 1024-bit keys are the minimum receivers accept and are no longer recommended. 4096-bit keys work but some DNS providers and receivers handle them poorly.

How often should I rotate DKIM keys?

A common practice is every 6 to 12 months, and immediately if the private key may have leaked. Publish the new selector, switch signing to it, and remove the old record after a few days.