Skip to Main Content

DKIM Record Generator

Generate an RSA key pair in your browser and get the DKIM TXT record to publish, plus the private key for your sending system. The key pair is created here and never sent anywhere.

Check this first. Google Workspace and Microsoft 365 generate DKIM keys for you in their admin console and will not accept a key you made elsewhere. In Microsoft 365 the private keys are not even accessible. If either of them sends your mail, use their own flow (Google, Microsoft) instead of this generator. A key from here is for a mail server or platform that asks you to supply one: Postfix with OpenDKIM, an appliance, or your own application.

The domain that signs the mail. Used to build the host name. It isn't part of the record value.

Any label you choose. It lets one domain hold several keys at once, which is what makes rotation possible without downtime.

Key size

2048-bit is the right default. 1024-bit is here only because some DNS panels still refuse the longer record. It is meaningfully weaker and should be treated as a temporary measure. Google offers 1024 as a fallback for exactly that reason, and Microsoft 365 defaults to 1024 with 2048 available on rotation.

1 · The public record: publish this in DNS

No key pair generated yet.

Choose a selector and key size, then generate. The pair is made by your browser’s own Web Crypto implementation. Neither half of the key is sent anywhere or stored.

2 · The private key: for your sending system only

The matching private key appears here after you generate.

After you publish

  1. Add the TXT record at your DNS host and give it up to an hour to propagate.
  2. Load the private key into the system that sends your mail, and configure it to sign with the selector palisade1.
  3. Confirm the published key resolves with the free DKIM checker, then send a test message to Gmail and check Show original for dkim=pass.
  4. DKIM on its own proves the message wasn’t altered. It doesn’t tell receivers what to do with mail that fails. Pair it with a DMARC record and SPF.

Sources

The record format follows RFC 6376. The two provider notes above come from Google's and Microsoft's own setup documentation.

Generating the key is the easy part. Living with it is the work

Keys need rotating, every sending service needs its own, and a DKIM record that quietly breaks looks fine in DNS. Palisade hosts DKIM by CNAME delegation, reads your DMARC reports to catch senders that fail, and drafts each fix for your approval.

Host my DKIM

1 domain free up to 1,000 emails/month

What is a DKIM creator?

This DKIM creator lets you generate DKIM keys in your browser. DKIM signs your outgoing mail with a private key and publishes the matching public key in DNS, so any receiver can confirm the message really came from your domain and arrived unaltered. Setting it up needs a key pair, and unlike SPF or DMARC you cannot write that by hand. This generator produces one in your browser: the public half comes out as the TXT record to publish, the private half as a PKCS#8 PEM file for your sending system. Before you use it, check whether your mail provider generates keys for you, because Google Workspace and Microsoft 365 both do and neither will accept an outside key. To see what a published record should look like before you add yours, here is what a DKIM record looks like, tag by tag, and the DKIM guides cover signing, selectors and rotation in more depth. Once the record is live, validate it with the DKIM checker, then pair it with SPF and a DMARC record.

Email authentication knowledge base

How do I generate a DKIM key?

You need an RSA key pair. The public half goes into DNS as a TXT record at selector._domainkey.yourdomain.com, and the private half goes into the system that sends your mail, which uses it to sign every outgoing message. The generator above makes the pair with your browser's built-in Web Crypto implementation, so the private key is created on your machine and never sent anywhere. The traditional alternative is openssl on a command line, which produces the same thing with more steps.

Can I use this key with Google Workspace or Microsoft 365?

No, and this is the most common wasted hour in DKIM setup. Google Workspace generates the DKIM key itself in the Admin console and gives you the resulting public record to publish. Microsoft 365 generates two key pairs when you enable DKIM for a custom domain, keeps the private keys inaccessible, and has you publish CNAME records that point at Microsoft's own selectors rather than a TXT record you control. Neither accepts an imported key. A key from this generator is for a mail server or platform that asks you to supply one: Postfix with OpenDKIM, an appliance, or your own application.

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

2048-bit. It is the stronger key and the one Google describes as preferred where the DNS provider supports it. 1024-bit exists as a fallback for panels that cannot store the longer record value, and Microsoft 365 still defaults to 1024 with 2048 available when you rotate. If you have to start at 1024 because of a DNS limitation, treat it as temporary and rotate up once the provider allows the longer value.

What is a DKIM selector?

A label that lets one domain hold several DKIM keys at the same time. The selector appears in the DNS host name (selector._domainkey.yourdomain.com) and in the s= tag of every signature you send, so receivers know which published key to check. Because the selector is part of the lookup, you can publish a new key under a new selector, switch your signing system over, and retire the old one without a gap in signed mail. That is what makes rotation possible. Different services usually get their own selector.

Is it safe to generate a DKIM private key in a browser?

The key here is produced by the Web Crypto API, the same cryptographic implementation the browser uses for TLS, and it is never sent over the network: there is no API call behind this page and nothing is stored. It is also not saved anywhere, so closing the tab destroys it. What you control is what happens next. Move the key straight into your mail server's secret store, and never paste it into a support ticket, a chat message, or a shared document. If your organization requires keys to be generated on a hardened machine under its own policy, use openssl there instead.

Why is my DKIM record too long for DNS?

A 2048-bit public key encodes to roughly 400 characters, and a single DNS character-string is capped at 255. The record itself is fine; it just has to be stored as several quoted strings that the DNS server joins back together. Most panels do this automatically when you paste the whole value. A few require you to split it yourself. If a DKIM checker reports the key as truncated or invalid after publishing, that split is almost always the cause.

How often should I rotate DKIM keys?

Rotate on a schedule your team will actually keep, and rotate immediately if a private key is ever exposed. The mechanism is the selector: publish the new public key under a new selector, wait for DNS to propagate, switch the signing system to the new selector, then remove the old record once no mail is signed with it. Microsoft rotates its own keys for you when DKIM is enabled on a custom domain. For keys you manage yourself, rotation is manual unless something automates it.

What do the tags in a DKIM record mean?

v=DKIM1 declares the version. k=rsa names the key type. p= carries the public key itself, base64-encoded. Those three are all a working record needs. Two optional tags show up in the wild: t=y marks the key as being tested, which tells receivers not to treat failures harshly, and h= restricts which hash algorithms may be used with the key. Leave both off unless you have a specific reason.

Does DKIM alone stop spoofing?

No. DKIM proves a message was signed by a key published for a domain and was not altered in transit. It does not tell receivers what to do when a message fails, and it does not require the signing domain to match the From address a recipient sees. DMARC adds both: alignment between the signing domain and the visible From domain, and a policy receivers act on. Publish DKIM, add SPF, then set a DMARC policy.