DMARC Monitor

DKIM record generator

Pick the service that sends your email and get the DKIM record to add to your DNS. Run your own mail server? Make the key pair here, in your browser.

Who sends your email?

We add it to the host names in your record. It stays on this page.

Who makes the key

You do. This page makes the 2048-bit key pair in your browser.

The name of this key. mail is fine, or use the year, like s2026.

Keep this key secret. It never leaves your browser. It goes on your mail server, for example as OpenDKIM's KeyFile. If you lose it, make a new pair.

Your DKIM record

We never change your DNS. Add the record where your DNS is managed.

My own server: TXT record

Host name

mail._domainkey

Make your key pair on the left and the value appears here.

Value

Split for DNS hosts with a 255-character limit

A 2048-bit key is longer than one DNS string. If your host rejects the value above, paste it as quoted strings like these.

Rather make the key with openssl?

Run these two commands on your server. The first makes the private key, the second prints the public key.

openssl genrsa -out dkim.private.pem 2048 openssl rsa -in dkim.private.pem -pubout -outform der | openssl base64 -A

The record value is v=DKIM1; k=rsa; p= followed by that output.

This browser can't make keys on this page. Use a current Chrome, Edge, Firefox or Safari, or the openssl commands above.

What goes in a DKIM record

The selector is the name of one key. It is the first part of the host name: the selector mail puts the key at mail._domainkey.yourdomain.com. Each message says which selector signed it.

TXT or CNAME. A TXT record holds the public key itself. A CNAME points at a key your provider hosts and rotates, so you paste it once. Use the type your provider asks for.

Key length. Use 2048 bits. RFC 8301 says at least 1024, and says it should be 2048. A 2048-bit key is longer than 255 characters, so some DNS hosts want it split into quoted strings. Most join it for you.

Paste it, then check that it worked.

Wait for DNS to update, then run your domain and selector through the DKIM checker to confirm receivers can read the key. DKIM is one of three records: the SPF record generator and the DMARC record generator make the other two.

Monitoring is the step after that. It rechecks your records every day and emails you when a change breaks one.

Questions

What is a DKIM selector?

A selector is the name of one DKIM key. It is the first part of the host name, so a key with the selector mail sits at mail._domainkey.yourdomain.com, and each signed message names it in the s= tag. Each sender usually has its own selector, which lets you run several and swap keys without a gap.

Should my DKIM record be a TXT or a CNAME?

Use what your provider asks for. A TXT record holds the public key itself. A CNAME points at a key the provider hosts, so it can change the key for you without you touching DNS again. Microsoft 365, SendWP, SendGrid, Amazon SES and Mailchimp use CNAMEs; Google Workspace, Zoho and Postmark give you a TXT record.

What DKIM key length should I use?

2048 bits. The DKIM standard (RFC 8301) says keys must be at least 1024 bits and should be 2048, and receivers ignore signatures from shorter keys. A 2048-bit key is longer than 255 characters, so some DNS hosts want it split into two quoted strings. Most join it for you.

Do I need to make my own DKIM key?

Only if you run your own mail server. Google Workspace, Microsoft 365, SendWP and the other services here make the key and show you the record, so you only paste it. If your server signs its own mail, make a key pair with the generator above and put the private key on the server.

Is it safe to make a DKIM key on a web page?

Here, yes: the key pair is made by your browser's built-in Web Crypto and never leaves your device. We don't send it, store it or log it. If you would rather make it yourself, the openssl commands in the generator give you the same thing.

How do I check my DKIM record works?

Wait for DNS to update, then enter your domain and selector in the free DKIM checker. It reads the record and tests the key type and length. To see a real message pass, send yourself an email and paste its headers into the email header analyzer.