Free tool
Generate a DKIM key pair for your own mail server. You get the TXT record to publish at selector._domainkey and the private key that signs your mail. The private key is not stored.
Select your email provider for specific instructions
Unique identifier for this DKIM key (letters, numbers, hyphens only)
Automate everything
Inboxkit automatically generates and manages DKIM keys with ongoing rotation.
Walkthrough
A 42-second walkthrough. On Google Workspace or Microsoft 365 you turn DKIM on in the admin console instead. For your own mail server, enter a selector, keep the 2048-bit key size and generate: you get the TXT record, the selector._domainkey host to publish it at, and the private key to keep secret.
Step 1
Choose Google Workspace, Microsoft 365, SendGrid, Mailchimp or Other / Custom. It only changes the setup steps shown with your result.
Step 2
A short name such as s2026 or mail1. Letters, numbers and hyphens only. The record will live at selector._domainkey.
Step 3
Keep 2048 bits. Leave Generate New Key Pair checked, or uncheck it to paste a public key you made yourself.
Step 4
Click Generate DKIM Record. Copy the TXT record and host, then copy or download the private key as a .pem file before you leave.
One click returns everything you need to start signing mail with a new key. A 2048-bit record with the default settings looks like this (the key is shortened):
Type: TXT Host: s2026._domainkey Value: v=DKIM1; h=sha256; s=email; p=MIIBIjANBgkqhkiG9w0BAQEFAAOC...IDAQAB TTL: 3600
v=DKIM1 marks the record, h=sha256 lists the allowed hash, s=email limits the key to email, and p= holds the public key in base64. Turning on testing mode adds t=y, and anything in Notes is added as n=.
Built from your selector as selector._domainkey. Your DNS host appends the domain, so receivers look the key up at s2026._domainkey.yourdomain.com.
An RSA private key in PKCS#8 PEM format (it begins with BEGIN PRIVATE KEY). Show, copy or download it as dkim-private-key-selector.pem, then install it on the server that signs your mail.
Steps for the provider you picked, plus a warning when the key is under 2048 bits, the record is over 255 characters, the selector is still default, or testing mode is on.
The key pair is generated on the Inboxkit server with Node.js crypto, not in your browser. The private key is sent back to you once and is not saved to a database or written to logs, so it is gone once you leave the page or click Generate New.
If your policy says private keys must never leave your machine, make the pair locally, uncheck Generate New Key Pair, and paste only the public key here, without its BEGIN and END lines:
openssl genrsa -out dkim.private 2048 openssl rsa -in dkim.private -pubout
The DKIM standard (RFC 8301) requires keys of at least 1024 bits and recommends 2048. Longer keys make longer records, and a single DNS TXT string holds at most 255 characters, so the size you pick decides how the record has to be stored.
| Key size | Record length | DNS storage | When to use it |
|---|---|---|---|
| 1024-bit | about 246 characters | Fits in one TXT string | Only for a DNS host that cannot store long TXT values. Valid, but below the 2048-bit level the DKIM standard recommends. |
| 2048-bit | about 422 characters | Two strings of up to 255 characters | The default and the right choice for almost every domain. Google Workspace also uses 2048-bit keys by default. |
| 4096-bit | about 766 characters | Four strings | Allowed by the standard, but some DNS hosts reject records this long. No deliverability benefit over 2048. |
Only if you control the server that signs your mail. Hosted providers keep the private key themselves, so a key you generate elsewhere is never used to sign anything.
The DKIM setup guide walks through each provider in more detail.
Enter your domain and selector in the DKIM checker to confirm the record resolves and the public key parses. From a terminal you can query it directly:
dig TXT s2026._domainkey.yourdomain.com +short
Then send a message to a Gmail address, open Show original and look for DKIM: PASS with your domain. DKIM is one of three records receivers check; once it passes, publish a policy with the DMARC generator and read how SPF, DKIM and DMARC work together.
FAQ
Enter a selector, keep the 2048-bit key size and Generate New Key Pair checked, then click Generate DKIM Record. You get three things: the TXT record value starting with v=DKIM1, the host name to publish it at (selector._domainkey), and the matching private key in PEM format to install on your mail server.
No. The key pair is generated on the Inboxkit server with Node.js crypto, sent back to your browser once, and not saved to a database or written to logs. It is gone when you leave the page or click Generate New, so download the .pem file before you do. If your security policy requires keys made on your own machine, run openssl genrsa -out dkim.private 2048 and paste the public key into the generator instead.
Use 2048-bit. The DKIM standard (RFC 8301) requires at least 1024 bits and recommends 2048, because 1024-bit RSA is now considered weak. The only cost is length: a 2048-bit record is about 422 characters, so it must be stored as two strings, which most DNS hosts handle for you.
No. Google Workspace creates the key in the Admin console (Apps, Google Workspace, Gmail, Authenticate email) and gives you a TXT record for google._domainkey. Microsoft 365 hosts the keys itself and asks you to publish two CNAME records, selector1._domainkey and selector2._domainkey. SendGrid, Mailchimp and most sending platforms also give you their own records. A key you generate elsewhere will not be used by these services, because they sign with a private key only they hold.
When you run the server that signs the mail: Postfix with OpenDKIM or rspamd, Exim, PowerMTA, Haraka or a similar MTA, or an SMTP relay or application that asks you to upload your own private key. You also need a new key pair when you rotate keys on such a server.
Add a TXT record. In the Name or Host field enter selector._domainkey, for example s2026._domainkey, and most DNS hosts add your domain automatically. Paste the whole value starting with v=DKIM1 into the Value field with no line breaks. Set TTL to 3600 or leave the default, save, then install the private key on your mail server with the same selector.
A single DNS TXT string holds at most 255 characters and a 2048-bit DKIM record is about 422. Many DNS hosts split long values automatically. Others, Amazon Route 53 for example, need you to enter the value as two quoted strings side by side. Receivers join the strings back together, so the split point does not matter.
Any short name made of lowercase letters, numbers and hyphens that is not already in use on your domain. Avoid default, because a dated or numbered selector such as s2026 or mail1 makes key rotation simple: publish the new key under a new selector, switch the server over, then remove the old record after a few days.
Once the record is published, enter your domain and selector in the Inboxkit DKIM checker to confirm the record is found and the public key parses. Then send a message from the server to a Gmail address, open Show original, and look for DKIM: PASS with your domain.
Related
Validate existing DKIM records and signatures.
Create SPF records for email sender authorization.
Complete domain authentication analysis.
Validate SPF records and sender policies.
Test email content for spam triggers.
Calculate optimal mailbox setup for campaigns.
Get started
Inboxkit automatically generates and manages DKIM keys for maximum email security.