DKIM Key Generator
Generate a DKIM key in your browser: the public TXT record to paste into DNS and the private key as PEM. RSA 2048 or Ed25519. Nothing is sent anywhere.
Updated 2026-10-21
The key pair is made by your browser (Web Crypto) and is never sent anywhere or put in the URL. The link copies only selector, key type and size into the address fragment, which never leaves your browser. Copy or download the private key before you leave: it is gone when you reload. Copy link to this result
Result
What is a DKIM key generator?
DNSVerdict's DKIM key generator creates a DKIM key pair inside your browser with the Web Crypto API. It shows the DNS host name (selector._domainkey.yourdomain), the TXT value for the public key, split into 255-character strings when it is long, and the private key as a PKCS#8 PEM file you can copy or download. RSA 2048 is the default and Ed25519 is offered where your browser supports it. Nothing is uploaded.
What this checks
DKIM lets a sending server sign each message with a private key, and lets receivers check that signature with a public key published in DNS. This tool makes the pair. Pick a selector (a label that names this key, such as s1 or a date like 202610), optionally your domain, and a key type. It then shows three things: the DNS host name where the public key goes, which is the selector followed by _domainkey and your domain; the TXT record value, which starts with v=DKIM1 and carries the public key in the p tag; and the private key, which your mail server or signing software needs. The private key never leaves this page: it is made by your browser's own crypto library and shown only here.
Key type and size. RSA is the type every receiver verifies. RFC 8301 §3.2 says signers MUST use RSA keys of at least 1024 bits and SHOULD use at least 2048, and that verifiers MUST be able to validate keys from 1024 to 4096 bits, so 2048 is the safe default. A 1024-bit key still works but is the floor, and 4096 bits makes a record of about 750 characters that some DNS hosts and resolvers handle badly. Ed25519 (RFC 8463) gives a very short record of about 70 characters, but support is still uneven: a receiver that does not implement it treats the signature as missing. RFC 8463 §6 therefore lets a sender add several signatures with old and new algorithms, so generate one RSA key and one Ed25519 key under two different selectors and sign every message twice.
Publishing the record. Create a TXT record at the host name shown and paste the value. A 2048-bit record is about 410 characters, longer than the 255 characters one DNS string can hold, so it travels as several strings that readers join without spaces (RFC 6376 §3.6.2.2). Most DNS panels split it for you when you paste the single string. If yours rejects a long value or truncates it, use the second box, which already has the quoted 255-character parts; the guide on TXT record quoting and the 255 limit explains both forms. After publishing, wait for the TTL and run the DKIM checker with the same selector.
The private key. It is shown as a PKCS#8 PEM block (BEGIN PRIVATE KEY), the format OpenSSL-based software such as OpenDKIM, Postfix filters and many mail servers read; some software expects a different layout for Ed25519, so check its documentation. Treat the file like a password: anyone who holds it can sign mail as your domain. Do not paste it in chat or tickets, store it with permissions only the mail service can read, and generate a fresh pair if it ever leaks. If you use Google Workspace, Microsoft 365 or another hosted service, do not use this tool: those services create the key and give you the record to publish. See how DKIM works and choosing a key length.
Privacy. Key generation uses the Web Crypto API (crypto.subtle) in this tab, with no network request. The link under the form copies only the selector, key type and size into the address fragment, which browsers never send to a server. The key itself is never placed in the URL, so sharing or bookmarking the page cannot leak it. It exists only in the page until you reload or leave, so copy or download it before you do.
If it fails
- Your browser says Ed25519 is not supported: choose RSA 2048, or update the browser. Ed25519 in Web Crypto arrived in Chrome 137, Firefox 129 and Safari 17.
- No key appears and the page mentions crypto: Web Crypto only works on secure pages (https:// or localhost), so open the site over HTTPS.
- Your DNS host rejects the value or says it is too long: use the split form with quoted 255-character parts, see TXT record quoting and the 255 limit.
- The DKIM checker says there is no record after you published: check the host name (some panels append the domain themselves, so enter only the selector._domainkey part) and wait for the TTL, see setting up DKIM.
- Signatures fail at receivers after the switch: the private key in your signing software must match the public key you published for that selector; if unsure, generate a new pair under a new selector.
FAQ
Is it safe to generate a DKIM private key in a web page?
Here it is: the key is created by your browser's Web Crypto API and is never sent to a server or put in the URL, so DNSVerdict cannot see it. You can check this in your browser's network tab. Like any private key, copy it to a safe place, do not share it, and generate a new pair if it ever leaks.
Should I use a 1024-bit or 2048-bit DKIM key?
Use 2048 bits if your DNS host accepts the longer record. RFC 8301 §3.2 says signers must use at least 1024 bits and should use at least 2048, while verifiers must accept 1024 to 4096 bits. A 1024-bit key is the allowed floor and still verifies, but it is weaker, so choose it only when a DNS limit forces you.
Can I use an Ed25519 key for DKIM?
Yes, RFC 8463 defines it, and the record is short. But not every receiver verifies Ed25519 yet, and one that does not will treat the signature as missing. RFC 8463 §6 lets you add several signatures, so sign each message with both an RSA key and an Ed25519 key under two selectors.
How do I publish the generated record?
Create a TXT record at the host name shown, selector._domainkey.yourdomain, and paste the value. If your DNS host limits strings to 255 characters, paste the split version with quoted parts instead. Then load the private key into your mail server or signing software, wait for the TTL and check the selector with the DKIM checker.