Keep your bounce rate under 3%. Verify your email list with catch-all email verifier Giggal.ai

Free DKIM key generator DKIM generator: create a DKIM key and record.

Generate a 2048-bit DKIM key pair in your browser and get the DNS record ready to paste. The DKIM record generator also formats a public key you already have, splits long records, and tells you when your provider makes the key for you.

Where does this domain send email from?

A date-based name makes rotating keys easy. Use a new selector for every new key.

Key type

Keys are generated in your browser with the Web Crypto API. Nothing is uploaded or stored.

Skip the DNS work. Sending cold email from Google Workspace or Microsoft 365? PureMail turns on 2048-bit DKIM, with SPF, DMARC and MX, on every domain we set up, in about 4 hours.

Get inboxes

Free, no sign-up. Keys are generated in your browser with the Web Crypto API; nothing is uploaded or stored. Updated .

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 fromWho makes the DKIM keyWhat you publish
Google WorkspaceGoogle, in the Admin console (Gmail, Authenticate email)TXT at google._domainkey
Microsoft 365Microsoft, in Defender (Email authentication settings)Two CNAMEs, selector1 and selector2
Zoho MailZoho, in the Mail admin consoleTXT at the selector you choose
SendGrid, Mailgun, Postmark, Amazon SES (Easy DKIM)The serviceThe CNAME or TXT records it shows
Amazon SES (Bring Your Own DKIM)You: use this DKIM key generatorTXT at your selector; upload the private key to SES
Your own server: Postfix with OpenDKIM, Exim, and similarYou: use this DKIM key generatorTXT 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

  1. Choose “My own server or another service” in the DKIM record generator.
  2. Enter your domain and a selector. The suggested selector is the month and year, which makes rotation easy.
  3. Pick RSA 2048-bit and press Generate DKIM key.
  4. Publish the public key: add a TXT record at selector._domainkey with the record value. Use the split version only if your DNS host asks for it.
  5. Install the private key on your mail server or upload it to your sending service, and turn signing on for the domain and selector.
  6. Check it: run the DKIM checker with your selector, then send a test email and look for dkim=pass in 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:

TagMeaningValue from this generator
vVersion. Optional, but if present must come first.DKIM1
kKey type.rsa or ed25519
pThe public key, base64. Empty means the key is revoked.Your new key
tFlags. y means testing: treat signed mail as unsigned.Only if you tick testing mode
hAllowed hash algorithms.Left out: SHA-256 is the default today
sService 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.com in 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:

  1. Generate a new key pair under a new selector with the DKIM generator.
  2. Publish the new public key and check it with the DKIM checker.
  3. Switch your mail server to sign with the new selector.
  4. Leave the old record for about a week, for mail still in transit.
  5. 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.

FAQ

DKIM generator: questions, answered.

Short answers about the check above.

01

What is a DKIM generator?

A DKIM generator creates a key pair for DKIM signing: a private key your mail server signs with, and a public key you publish in DNS as the DKIM record. This DKIM generator makes the keys in your browser, formats the record, and splits it for DNS hosts that need short strings.

02

How do I generate a DKIM key?

Choose “My own server or another service”, enter your domain and a selector, pick RSA 2048-bit and press Generate DKIM key. Publish the public key as a TXT record at selector._domainkey.yourdomain.com and install the private key on your mail server.

03

Do I need a DKIM generator for Google Workspace?

No. Google Workspace creates the key itself: in the Admin console go to Apps, Google Workspace, Gmail, Authenticate email, generate a 2048-bit record, add it to DNS at google._domainkey and press Start authentication. A key made anywhere else would never be used.

04

How do I generate a DKIM key in Office 365?

You don’t: Microsoft 365 (Office 365) creates and rotates the keys. In Microsoft Defender, open Email authentication settings, then DKIM, select the domain, add the two CNAME records it shows (selector1 and selector2) at your DNS host and switch signing on.

05

What does a DKIM record look like?

A TXT record at selector._domainkey.yourdomain.com with a value such as v=DKIM1; k=rsa; p=MIIBIjANBgkq… The long p= value is the public key; a 2048-bit RSA key makes it about 400 characters.

06

Should I use a 1024-bit or 2048-bit DKIM key?

2048-bit. It is the current recommendation and Google’s default. Use 1024-bit only if your DNS host cannot store a record over 255 characters, and move to 2048 as soon as you can. Keys under 1024 bits are treated as unsigned.

07

What is a DKIM selector?

The name that tells receivers where to find the public key, so one domain can have several keys. It is the first part of the DNS name (selector._domainkey.yourdomain.com) and appears as s= in every signature. Use a new one for every new key, such as nov2026.

08

Why is my DKIM record too long for my DNS host?

A TXT string holds at most 255 characters and a 2048-bit DKIM record is about 410. Most DNS hosts split it for you. If yours does not, paste the split version from the DKIM record generator, which writes the record as several quoted strings that receivers join back together.

09

Is it safe to generate a DKIM key online?

With this DKIM key generator, the key is made by your own browser’s Web Crypto API and never sent anywhere, the same way it would be on your server. Still, save the private key somewhere safe and never share it: anyone holding it can sign email as your domain.

10

Can I use Ed25519 for DKIM?

Yes, as defined in RFC 8463, but not on its own: many receivers still only verify RSA signatures. Sign with both an RSA 2048-bit key and an Ed25519 key under different selectors, so every receiver can check at least one.

11

How often should I rotate DKIM keys?

M3AAWG, the industry anti-abuse group, recommends at least twice a year. Generate a new key under a new selector, publish it, switch signing to it, wait about a week, then revoke the old key by publishing its record with an empty p=.

12

How do I check that DKIM works?

Run the DKIM checker with your domain and selector to confirm the record is published and the key length is right. Then send an email to a Gmail or Outlook address and paste its header into the email header analyzer: you should see dkim=pass for your domain.

13

Do I need DKIM if I have SPF?

Yes. Gmail and Yahoo require DKIM from bulk senders, and DKIM survives forwarding where SPF breaks. DMARC passes when either aligns with your From domain, so having both gives two chances to pass.

14

Is this DKIM record generator free?

Yes. The DKIM record generator is free with no sign-up and no limits. Keys are generated in your browser, and nothing is uploaded or stored.

Still have a question? support@puremail.ai · contact us

Your next reply is one order away.

Google Workspace and Microsoft 365 inboxes from $2.90 a month, set up and connected to your sequencer today.