DKIM Key & Record Generator
Make a DKIM key on your device: the TXT record, BIND lines and mail-server settings.
Try before you buy.
- Free preview: the DNS record’s name and layout and the first lines of each file, with every key hidden after its first characters.
- Locked until you unlock it: download and copy.
- Unlock: Pro pass, ₹179 for 30 days or ₹79 for 1 week, a one-time payment that never renews. Unlock: Pro pass, $5.99 for 30 days or $2.99 for 1 week, a one-time payment that never renews.
Ways to unlock shows how to get the full result.
Printing this result is locked in the free preview.
Your DKIM record
1. Publish the TXT record
- Name in DNS host forms
- Full name
- Type
- TXT
2. Install the private key secret
Keep it only on the mail server, readable by the signing software alone. It exists only on this page until you save it.
3. Set up the mail server
4. Check it
Once your DNS host shows the record (allow for its TTL), check it with the , then send yourself a message and look for dkim=pass in its Authentication-Results header.
Locked in the free preview. Opens the ways to unlock this result.
Locked in the free preview. Batch runs unlock with a pass.
Locked in the free preview. Query results unlock with a pass.
About the DKIM Key & Record Generator
DKIM signs every message your domain sends with a private key on your mail server; receivers check the signature with the public key you publish in DNS as a TXT record at selector._domainkey.yourdomain. This page makes the key pair and everything around it: the DNS record as one value, split into 255-character strings for zone files and DNS hosts that need them, the private key in PEM form, and ready lines for OpenDKIM, Postfix and Exim.
The keys are made by your browser’s Web Crypto API and never leave this page: nothing is uploaded or stored, and the page works offline once loaded. Choose RSA 2048 (the size RFC 8301 recommends), RSA 1024 for a DNS host that cannot store a longer record, RSA 4096, or Ed25519 where your browser supports it. Already have a private key? Paste it and get its DNS record.
Without a pass, the free preview shows the record’s name and layout and the first lines of each file, with every key hidden after its first characters; copying, the downloads and the ZIP unlock with a Pro pass.
How to use it
- Enter your domain (the part after @ in the From address) and a selector, a short name for this key such as
mailormail2. - Choose the key type: RSA 2048 fits nearly everywhere. Tick Testing mode while you set up, if you like (receivers then treat the mail as unsigned whatever happens).
- Press Make key and record. To publish an existing key instead, choose Use my private key and paste it.
- Add the TXT record at your DNS host, put the private key on the mail server and add the settings; with a pass you can copy each block or download them all as a ZIP (the free preview shows the first lines with keys hidden).
- Check the published record with the DKIM Record Checker, then send yourself a message and look for
dkim=pass.
Examples
Name: mail._domainkey.example.com (TXT) Value: v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA… (410 characters) Zone file: two strings of 255 and 155 characters in parentheses
One TXT string holds at most 255 characters (RFC 1035 §3.3), so a 2048-bit key is published as two strings in one record; receivers join them without spaces.
Value: v=DKIM1; k=ed25519; p= followed by 44 characters, which fits in one string
RFC 8463 publishes the raw 32-byte public key. Sign with an RSA key as well, under another selector, for receivers that do not check Ed25519 yet.
-----BEGIN RSA PRIVATE KEY----- MIICXwIBAAKBgQDwIRP/UC3S… (the key in RFC 6376 Appendix C)
RSA 1024-bit · p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDwIRP/UC3S… — the same value the RFC publishes
Common uses
- Setting up DKIM on your own mail server with OpenDKIM and Postfix, or with Exim.
- Rotating a DKIM key: a new selector and key, published before the old one is retired.
- Replacing a 1024-bit key with a 2048-bit one, as RFC 8301 recommends.
- Getting the DNS record for a private key you already have.
The record
The TXT record goes at selector._domainkey.yourdomain (many DNS host forms take just selector._domainkey in the name field and add the domain themselves). Its value is a list of tags (RFC 6376 §3.6.1): v=DKIM1 first, k=rsa or k=ed25519, and p= the public key in base64. For RSA that is the SubjectPublicKeyInfo, exactly as RFC 6376 Appendix C publishes it; for Ed25519 the raw 32-byte key (RFC 8463 §4.2). Optional tags:
t=y: testing mode. Verifiers must treat the mail like unsigned mail even when a signature fails, which is useful while you set up. Remove it once signing works.t=s: thei=domain in signatures must be exactly thed=domain, not a subdomain.h=sha256: only SHA-256 signatures (rsa-sha1 must not be used anyway, RFC 8301 §3.1).
One TXT string holds at most 255 characters (RFC 1035 §3.3), and a 2048-bit record is longer, so it is published as several quoted strings in one record, which receivers join without spaces (RFC 6376 §3.6.2.2). Some DNS host forms split a long value for you; others want the quoted strings on one line (Route 53’s TXT format): both forms are given.
Choosing the key
- RSA 2048-bit: recommended. Signers must use at least 1024 bits and should use at least 2048; verifiers handle 1024 to 4096 bits (RFC 8301 §3.2).
- RSA 1024-bit: still valid and fits in one string, for DNS hosts that cannot store a longer record. Move to 2048 when you can.
- RSA 4096-bit: the largest size verifiers must accept; the record needs three strings.
- Ed25519 (RFC 8463): a short record and fast signatures. Signers should and verifiers must implement it (RFC 8463 §5); for receivers that do not check it yet, sign with an RSA key as well, under a second selector (§6 allows signatures with both algorithms). Your browser must support Ed25519 in its Web Crypto API to make one here.
Installing the key
- OpenDKIM reads a PEM private key from
KeyFile, or from aKeyTablethat maps a key name to domain, selector and file, with aSigningTablethat says which From addresses use it ([opendkim.conf(5)](http://www.opendkim.org/opendkim.conf.5.html)). It refuses a key file that other users can read (RequireSafeKeys). Ed25519 keys need OpenDKIM 2.11 or later,SignatureAlgorithm ed25519-sha256in single-key mode, or the algorithm as a fourth KeyTable field (OpenDKIM’s development documentation). - Postfix hands mail to OpenDKIM with
smtpd_miltersandnon_smtpd_milters(MILTER_README); note that Postfix writes the address asinet:localhost:8891while OpenDKIM’sSocketline writesinet:8891@localhost.milter_default_action = acceptlets mail go out unsigned if OpenDKIM is down; the default,tempfail, holds it. - Exim signs in the SMTP transport with
dkim_domain,dkim_selectoranddkim_private_key(Exim’s specification). - Check it:
opendkim-testkey -d domain -s selector -k keyfile -vvvcompares the published record with the private key file ([opendkim-testkey(8)](http://www.opendkim.org/opendkim-testkey.8.html)).
Rotating keys
- Make a key under a new selector (for example
mail2) and publish its record next to the old one. - Wait until the new record is visible everywhere (at least the old record’s TTL), then switch the mail server to the new key.
- Keep the old record for a few days, so messages signed with it can still be checked on arrival.
- Retire the old selector by publishing it with an empty
p=, which marks the key as revoked (RFC 6376 §3.6.1), or delete it.
Limitations
- Ed25519 keys need a browser whose Web Crypto API supports Ed25519; otherwise choose RSA.
- Keys exist only on this page: if you close it before saving the private key, make a new one.
- Passphrase-protected private keys cannot be read here; remove the passphrase on your server first (a mail server needs the key without one).
- This page does not change your DNS or your mail server: you add the record and the settings yourself.
Privacy
On this device: nothing is sent
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
What do I get without a pass?
Without a pass, DKIM Key & Record Generator shows the DNS record’s name and layout and the first lines of each file, with every key hidden after its first characters. Until you unlock it, the result can’t be downloaded or copied. A Pro, Premium or Ultimate pass, a one-time payment that never renews, unlocks the full result. The pricing page lists the passes and their prices.
Is it safe to make a DKIM private key in a browser?
Here the key is made by your browser’s own Web Crypto API, from its cryptographically secure random number generator. It is never sent anywhere: MySmartCoPilot’s servers are not involved, and nothing is stored. Treat it like any private key: keep it on the mail server, readable only by the signing software.
Why is my DKIM record split into several strings?
A 2048-bit public key makes a value of about 410 characters, and one TXT string holds at most 255 (RFC 1035 §3.3). The record therefore holds two quoted strings, and receivers join them without spaces. Use the zone-file form for BIND-style files and the one-line quoted form for DNS hosts that ask for it.
What should I choose as a selector?
Any short name of letters, digits and hyphens: mail, mail2, s1. Use a new selector for every new key, so the old key can stay published until mail signed with it has been delivered.
Which private key format do I need?
The default is PKCS#8 (“-----BEGIN PRIVATE KEY-----”), which OpenDKIM and Exim read. For RSA keys the PKCS#1 form (“-----BEGIN RSA PRIVATE KEY-----”) is offered too, for software that asks for it; both hold the same key.
My provider signs my mail already. Do I need this?
Usually not: services such as Google Workspace or Microsoft 365 make their own keys and give you a record to publish. This page is for mail you send from your own server, or for a service that asks you to supply a key.