Free tools / DKIM key generator
DKIM key generator
Make a DKIM key pair in your browser: the DNS record to publish, and the private key for your mail server.
- Made in your browser
- Private key never leaves the page
- 2048 or 4096 bits
What DKIM is
DKIM (DomainKeys Identified Mail) signs every message you send. Your mail server holds a private key and adds a signature to each message. The matching public key sits in your DNS. A receiving server fetches it, checks the signature, and knows two things: the message really came from your domain, and nobody changed it on the way.
When you need this tool
Most hosted email services make the key for you and give you a record to publish. Use that when it's offered. Generate your own here when you run your own mail server, or when a service asks you to supply a key pair.
Using the result
- Public key. Add a TXT record with the name shown (
selector._domainkey) and paste the value. A long value may need to be split into quoted pieces; most DNS providers do that for you. - Private key. Give it to your mail server along with the selector. In Postfix with OpenDKIM, Exim, or a sending library, this is the "DKIM private key" setting.
- Test. Send yourself a message, then look for
dkim=passin its headers with the header analyser, or check the selector with the domain check.
About the selector
The selector is just a label that lets one domain have several keys: one per service, or an old and a new one during a change. Pick anything short. To replace a key later, generate a new pair under a new selector, switch your server to it, and remove the old record after a few days.
Questions
Is it safe to generate a private key on a web page?
Here, yes: the key pair is made by your browser's built-in cryptography and never leaves the page. Nothing is sent to Prodmail or anyone else, and you can confirm that by turning off your connection before pressing the button. Still, treat the private key like a password once you have it.
Should I choose 2048 or 4096 bits?
- It is the size every major provider uses and it fits in any DNS provider's limits. 1024-bit keys are no longer considered safe.
Can I use the same key for several domains?
You can, but don't. A key per domain means a leak or a change affects only one.
How often should I change the key?
Once or twice a year is a sound habit, and at once if the private key may have been exposed.