DKIM record generator

Paste the public key your mail server or provider gave you, enter the selector and domain, and copy the DNS record. The tool detects RSA or Ed25519 keys, checks the RSA key size and splits long values for zone files. Keys stay in your browser.

PEM (-----BEGIN PUBLIC KEY-----), bare Base64 or an existing record with p=. Never paste the private key.

RSA key, 2,048 bits.

410 characters, 2 string(s) of up to 255 characters in a zone file.

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Generate a key pair in your mail server or copy the public key from your email provider’s DKIM settings.
  2. Enter the selector the server signs with and your domain.
  3. Paste the public key. PEM blocks, bare Base64 and old records (v=DKIM1; … p=…) all work.
  4. Copy the host name and the TXT value into your DNS panel, or the zone-file line into a BIND zone.

How it works

The record follows RFC 6376: v=DKIM1 comes first, then k= with the key type and p= with the key in Base64. Optional tags are h=sha256 (accept only SHA-256 signatures) and t= with the flags y (testing) and s (the i= domain of a signature must equal d=, no subdomains).

The key is decoded and its type read from the DER structure:

  • RSA: a SubjectPublicKeyInfo key (the PEM that starts with MIIB…) is used as it is. A PKCS#1 key (BEGIN RSA PUBLIC KEY) is wrapped into SubjectPublicKeyInfo, the form DKIM records normally carry. The size is the modulus length. RFC 8301 says signers must use at least 1024 bits and should use at least 2048, so shorter keys are refused and 1024-bit keys get a warning.
  • Ed25519: RFC 8463 puts the raw 32-byte key into p=, so a SubjectPublicKeyInfo block is reduced to those 32 bytes.

For the zone file the value is cut into strings of 255 characters, because one TXT string holds at most 255 bytes.

Example

With the selector mail, the domain example.com and the 2048-bit RSA key shown in the form, the record is:

  • Host name: mail._domainkey.example.com
  • Value: v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA…IDAQAB — 410 characters.
  • Zone file: two strings, 255 + 155 characters.

Tips

  • Check the record after publishing: dig TXT mail._domainkey.example.com +short should print the value.
  • Keep the old selector published for a few days when you rotate keys, so messages signed before the switch still verify.
  • DKIM works best together with SPF and a DMARC policy.

Frequently asked questions

Where do I put the DKIM record?

Create a TXT record whose name is the selector followed by ._domainkey, for example mail._domainkey for the domain example.com. Many DNS panels add the domain automatically, so you type only mail._domainkey. The value is the text that starts with v=DKIM1.

What is a DKIM selector?

A label chosen by the sender that tells receivers which key to fetch. The signature in each message names it (s=mail). Different selectors let you run several keys at once, for example one per mail service, and rotate keys without downtime.

Why is my record split into several strings?

A single string inside a TXT record can hold at most 255 characters, and a 2048-bit RSA key is longer than that. In a zone file the value is written as several quoted strings in a row; DNS servers return them together and receivers join them without spaces. Most web DNS panels split the value for you, so paste it in one piece there.

RSA or Ed25519?

RSA 2048 works with every receiver. Ed25519 keys (RFC 8463) are much shorter, but not every receiver verifies them yet, so a common setup signs each message twice: with Ed25519 and with RSA, under two selectors.

What does t=y do?

It marks the domain as testing DKIM. Receivers should not treat signed messages differently from unsigned ones because of it. Remove the flag once signatures verify.

Is my key sent anywhere?

No. The record is built in your browser. A public key is meant to be published in DNS anyway, but the tool refuses private keys so they are not pasted by mistake.

More in Developer

All tools in this category: Developer ·Updated November 4, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.