What this DKIM generator does
DKIM (DomainKeys Identified Mail) signs every email you send with a private key. Receivers fetch the matching public key from your DNS and check the signature, which proves the email came from your domain and was not changed on the way. This DKIM generator gives you both halves:
- A new key pair: RSA 2048-bit (recommended), RSA 1024-bit, or Ed25519, made by your browser’s built-in Web Crypto API. The private key is never uploaded.
- The DKIM record, ready to paste, with the exact host name (
selector._domainkey) and a version split into 255-character strings for DNS hosts that need it. - The private key as a PEM file, plus the OpenDKIM lines that install it on Postfix.
- A record from a key you already have: paste a public key, or a messy DKIM record, and the DKIM record generator writes a clean one.
- The right advice for Google Workspace and Microsoft 365, which make their own keys, so you never publish one that is never used.
Do you need to generate a DKIM key?
Often not. Most email providers generate the key pair themselves, keep the private key, and give you only the DNS record to publish. Generate your own only when you run the mail server or the service asks you to bring a key:
| Sending from | Who makes the DKIM key | What you publish |
|---|---|---|
| Google Workspace | Google, in the Admin console (Gmail, Authenticate email) | TXT at google._domainkey |
| Microsoft 365 | Microsoft, in Defender (Email authentication settings) | Two CNAMEs, selector1 and selector2 |
| Zoho Mail | Zoho, in the Mail admin console | TXT at the selector you choose |
| SendGrid, Mailgun, Postmark, Amazon SES (Easy DKIM) | The service | The CNAME or TXT records it shows |
| Amazon SES (Bring Your Own DKIM) | You: use this DKIM key generator | TXT at your selector; upload the private key to SES |
| Your own server: Postfix with OpenDKIM, Exim, and similar | You: use this DKIM key generator | TXT at your selector; install the private key on the server |
For cold email, sending is almost always from Google Workspace or Microsoft 365 inboxes connected to a sequencer, so the provider’s own DKIM setup is what matters, and the DKIM record generator shows those steps instead of a key. Pick your provider at the top of the DKIM generator for the exact steps.
How to generate a DKIM key: step by step
- Choose “My own server or another service” in the DKIM record generator.
- Enter your domain and a selector. The suggested selector is the month and year, which makes rotation easy.
- Pick RSA 2048-bit and press Generate DKIM key.
- Publish the public key: add a TXT record at
selector._domainkeywith the record value. Use the split version only if your DNS host asks for it. - Install the private key on your mail server or upload it to your sending service, and turn signing on for the domain and selector.
- Check it: run the DKIM checker with your selector, then send a test email and look for
dkim=passin the email header analyzer.
The DKIM record, tag by tag
The record the DKIM generator writes looks like v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEF…. Each tag means:
| Tag | Meaning | Value from this generator |
|---|---|---|
v | Version. Optional, but if present must come first. | DKIM1 |
k | Key type. | rsa or ed25519 |
p | The public key, base64. Empty means the key is revoked. | Your new key |
t | Flags. y means testing: treat signed mail as unsigned. | Only if you tick testing mode |
h | Allowed hash algorithms. | Left out: SHA-256 is the default today |
s | Service type. | Left out: email is the default |
The record lives at selector._domainkey.yourdomain.com. In most DNS hosts you type only selector._domainkey in the host field, because the host adds your domain.
RSA 2048, RSA 1024 or Ed25519?
- RSA 2048-bit is the right choice for almost everyone. Every receiver verifies it, and it is the length Google Workspace uses by default.
- RSA 1024-bit still verifies everywhere and fits in one 255-character TXT string, but it is weaker. Use it only if your DNS host cannot take a longer record, and plan to move.
- Ed25519 (RFC 8463) makes a short, fast key, but many receivers do not verify it yet. Use it only as a second signature next to RSA, under its own selector. The DKIM key generator offers it when your browser supports it.
Larger RSA keys (3072 or 4096-bit) are allowed, and RFC 8301 requires receivers to verify keys up to 4096 bits, but a 4096-bit record runs past 700 characters and some DNS hosts struggle with it. 2048-bit is the practical choice, so this DKIM generator stops there.
Long DKIM records and the 255-character limit
A single string in a TXT record can hold at most 255 characters, and a 2048-bit DKIM record is about 410. The DNS standard allows a TXT record to hold several strings, which receivers join back together, so the record still works; the question is only how your DNS host takes it:
- Cloudflare, GoDaddy, Namecheap and most web dashboards: paste the long value as it is; they split it for you.
- BIND zone files and Amazon Route 53: paste the split version, which the DKIM record generator writes as quoted strings:
"v=DKIM1; k=rsa; p=MIIB…" "…IDAQAB".
If the DKIM checker later reports a key that cannot be read, the usual cause is a record cut off at 255 characters, or a split version pasted with the quotes into a host that adds its own.
Choosing a DKIM selector
The selector is just a name, but a good one saves trouble later. Use letters, numbers and hyphens, and give every new key a new selector. A date-based name such as nov2026, which the DKIM generator suggests, tells you at a glance how old the key is and makes rotation simple: the old and new keys can sit side by side while you switch. Avoid reusing the provider names google, selector1 or selector2 for your own keys on a domain that also sends through those providers.
Installing the private key: OpenDKIM and Postfix
On a Postfix server with OpenDKIM, save the private key as /etc/opendkim/keys/yourdomain.com/selector.private, readable only by the opendkim user, then add one line to the KeyTable and one to the SigningTable. The DKIM record generator writes both lines with your domain and selector filled in. Restart OpenDKIM, send a test email and check the result. Other mail servers, such as Exim, take the same PEM private key in their own configuration, and Amazon SES takes it under Bring Your Own DKIM.
Common DKIM record mistakes
Most DKIM failures come from how the record was published, not from the key. The DKIM record generator avoids the first four; the last two are worth checking on any domain:
- The domain typed twice: entering
selector._domainkey.yourdomain.comin a host field that adds the domain, which creates…yourdomain.com.yourdomain.com. - A cut-off key: a 2048-bit record pasted into a field that silently stops at 255 characters.
- Line breaks or spaces inside p=, copied from a PEM file. The DKIM record generator writes the key on one line.
- The private key published by mistake. The record must hold the public key only; the generator refuses to format a private key.
- Signing not switched on. The record is live but the server or provider is not signing with that selector yet; Google Workspace needs Start authentication.
- A different selector in the server’s configuration than in DNS, so receivers look in the wrong place.
Run the DKIM checker after any change; it reads the record exactly as receivers do and reports the key length.
Rotating DKIM keys
M3AAWG, the industry anti-abuse group, recommends rotating DKIM keys at least twice a year, so that a leaked key cannot be used for long. With selectors, rotation needs no downtime:
- Generate a new key pair under a new selector with the DKIM generator.
- Publish the new public key and check it with the DKIM checker.
- Switch your mail server to sign with the new selector.
- Leave the old record for about a week, for mail still in transit.
- Revoke the old key by changing its record to
v=DKIM1; p=(empty), and delete the old private key.
Google Workspace and Microsoft 365 handle this differently: Google lets you generate a new key in the Admin console, and Microsoft rotates its keys for you.
Why DKIM matters for cold email
Gmail and Yahoo require DKIM from bulk senders, and DMARC needs DKIM or SPF to pass for your own domain. That last part is where cold email setups go wrong: if DKIM was never set up, Google Workspace signs with a gappssmtp.com domain and Microsoft 365 with an onmicrosoft.com domain. DKIM passes, but it does not align, and DMARC rests on SPF alone. Paste any email you sent into the email header analyzer to see which domain signed it, and set up DKIM for your own domain if it is not yours. Then add SPF and DMARC records, and test all four records on the free email deliverability tools page.
Or let PureMail handle it: we turn on 2048-bit DKIM for every Google Workspace and Microsoft 365 inbox we set up, with SPF, DMARC and MX done on every domain, in about four hours, from $2.90 an inbox.