DKIM generator for all your domains

This free DKIM generator creates a key pair and the TXT record to publish for up to 10 domains in one run. Each domain gets its own key, all at the selector you pick.

No signup. Keys are made in your browser and never sent to us.

By Rares Serban · Last updated November 21, 2026

One selector for every domain in this run. Pick a name these domains don't use yet, so the keys your other senders publish stay as they are.

Key type

Recommended. Every DKIM verifier supports it.

Only for DNS hosts that can't store long TXT records.

Keys are made in your browser with WebCrypto. Nothing is sent or stored.

How to use the DKIM generator

Paste up to 10 domains or subdomains into the box at the top of this page, one per line. Keep the selector mail or type your own, pick a key type, and click Generate DKIM keys. Each domain gets a key pair of its own, all at the same selector. No domains at hand? Example fills in two and makes keys for them.

Each domain gets a card with:

  • Name: where the record goes, <selector>._domainkey.<domain>, plus the shorter name to type in DNS panels that add your domain for you.
  • Value: the TXT record, v=DKIM1; k=rsa; p= followed by the public key, with a view split into 255-character strings.
  • Private key: the PEM file your mail server signs with, to copy or download as <domain>.<selector>.private.
  • OpenDKIM lines: the KeyTable and SigningTable entries, folded away until you open them.
  • Check it after publishing: opens the DKIM checker on that record in a new tab, so your keys stay on this page.

The keys are made in your browser with the Web Crypto API. Nothing is sent to our server or stored, and nothing goes into the page address. Every click makes new keys, so save each private key before you leave the page or generate again.

Pick a selector these domains don't use yet. A domain holds one key per selector, so reusing a name another sender already publishes, like google or resend, would clash with its key.

Where to publish the record

Add the record at your DNS host, which is wherever your domain's nameservers point. That isn't always the registrar.

  • Type: TXT.
  • Name: mail._domainkey (with your selector in place of mail) in panels that add your domain to every name, like Cloudflare, Porkbun, Namecheap and GoDaddy. Typing the full name there puts the record at mail._domainkey.yourdomain.com.yourdomain.com, where no receiver looks.
  • Value: the whole v=DKIM1; ... value as one piece. If your host rejects it as too long, paste the split version instead.
  • TTL: the default is fine.

A subdomain you send from needs its own record and its own key, since keys don't carry over from the parent domain. For updates.yourdomain.com in the yourdomain.com zone, the short name is mail._domainkey.updates, and the card shows it. Our guide to email on a subdomain shows a subdomain's DKIM record on a live domain.

Then install the private key on your mail server and set it to sign as that domain with that selector. Send yourself a message and paste its headers into the email header analyzer: the DKIM-Signature header should show your domain in d= and your selector in s=, and the receiver should record a DKIM pass.

RSA 2048, 1024 or Ed25519

RFC 8301 section 3.2 sets the rules for RSA keys: signers must use at least 1024 bits and should use 2048, and receivers must not accept signatures made with keys under 1024 bits. Sign with SHA-256 (rsa-sha256), since RFC 8301 no longer allows SHA-1 for DKIM.

  • RSA 2048 (the default): use this one. Receivers have to support keys from 1024 to 4096 bits, so it works everywhere. Its TXT value is 410 characters, longer than one 255-character DNS string, so it's stored as two strings that receivers join on lookup (RFC 6376 section 3.6.2.2).
  • RSA 1024: its value is 234 characters and fits in one string. Pick it only if your DNS host can't store a longer TXT record. It meets the minimum, so it's still valid.
  • Ed25519: a newer, much shorter key type from RFC 8463, with k=ed25519 and a 44-character p=. Not every receiver checks Ed25519 signatures, so publish it next to an RSA key at a second selector and sign with both. The option only shows up when your browser can make Ed25519 keys.

When you don't need to generate a key

Most hosted senders make the key pair for you and keep the private half on their side. Google Workspace generates it in the Admin console, Resend shows you its record when you add a domain, and Mailyond creates a key for every domain you connect. You copy one DNS record, and there's no key file to look after. A key you make here wouldn't help with those, since each sender signs with the key it holds.

This generator is for when you hold the signing key yourself: your own mail server (Postfix with OpenDKIM, or Exim), an app that signs its own mail, or a tool that asks you to bring your own key. If you send as several domains, each one needs its own key and record, and our guide to sending email from multiple domains compares the ways to set that up.

FAQ

What is a DKIM generator?

A tool that makes the two halves of a DKIM key: the private key your mail server signs messages with, and the public key you publish in DNS as a TXT record so receivers can check those signatures. This one also writes the record name and value for each domain, the split version for long values, and the OpenDKIM config lines.

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

Yes. The keys are made on your device with the browser's built-in Web Crypto API, and the private key is never sent to us or stored, not even in your browser's storage. Our analytics only counts how many domains you entered and which key type you picked, never the domains. Treat the private key like a password: whoever holds it can sign mail as your domain. If it leaks, publish a new key at a new selector, switch signing to it, then empty the old record's p= to revoke the old key.

Which key length should I use?

RSA 2048. RFC 8301 requires at least 1024 bits and recommends 2048, and receivers must reject keys under 1024. Only fall back to 1024 if your DNS host can't store a TXT record longer than 255 characters. Ed25519 works as a second key next to an RSA key, not on its own.

My DNS host says the TXT record is too long. What do I do?

Open the split view on the domain's card. It cuts the value into strings of up to 255 characters, each in quotes, like "v=DKIM1; k=rsa; p=MIIBIjAN..." "...IDAQAB". Paste the whole line, quotes included: receivers join the strings back into one value. BIND zone files and Route 53 take this format. If your host still refuses it, generate an RSA 1024 key, which fits in one string.

Can one domain have more than one DKIM key?

Yes, one per selector. Google, your newsletter tool and your own server can each sign with a key of their own, at names like google._domainkey, k1._domainkey and mail._domainkey. What breaks is two TXT records at the same name, so pick a selector that's free. To rotate a key, publish the new one at a new selector, switch signing over, and revoke the old one a few days later.