---
title: "DKIM record generator"
url: "https://coldagentai.com/tools/dkim-generator.md"
canonical_url: "https://coldagentai.com/tools/dkim-generator"
last_updated: "2026-10-18"
type: "tool"
summary: "Generate a 2048-bit DKIM key pair in your browser and get the DNS host and TXT value, split into 255-character strings for DNS providers that need it."
related: ["https://coldagentai.com/tools.md", "https://coldagentai.com/tools/dkim-checker.md", "https://coldagentai.com/tools/spf-generator.md", "https://coldagentai.com/tools/dmarc-generator.md", "https://coldagentai.com/tools/list-unsubscribe-generator.md", "https://coldagentai.com/tools/spf-checker.md"]
install: "claude mcp add --transport http coldagentai-free https://coldagentai.com/api/mcp"
---

# DKIM record generator

> **For AI agents:** the complete index of ColdAgentAI pages is [llms.txt](https://coldagentai.com/llms.txt). Every page is also served as markdown at its URL plus .md.

Generate a 2048-bit DKIM key pair in your browser and get the DNS host and TXT value, split into 255-character strings for DNS providers that need it.

DKIM lets a receiving server confirm that a message really came from your domain and was not changed on the way. It works with a pair of keys: the private key stays with the system that sends your mail, and the public key sits in your DNS. This page makes a fresh 2048-bit pair inside your browser, so the private key never leaves your device, and writes the DNS record for you.

The key pair is made by your browser and stays on your device; this page never sends the key, the selector or the domain anywhere.

## Inputs

- Selector: a short name for this key, using letters, digits, hyphens and underscores. It becomes the first part of the DNS host name. A date in the name, such as s202610, makes rotation easy to track.
- Domain: the domain you send from, for example example.com.

## How it works

- The tool asks your browser's built-in WebCrypto to make an RSA key pair with a 2048-bit modulus, the public exponent 65537 and the RSASSA-PKCS1-v1_5 signature scheme with SHA-256, the combination DKIM uses.
- The public key is exported in the SPKI format and written as base64 on one line. That is the text that goes after p= in the record.
- The private key is exported in the PKCS8 format and wrapped as a PEM block with 64 character lines, which most sending platforms accept.
- The DNS host is your selector, then ._domainkey., then your domain. The TXT value is v=DKIM1; k=rsa; p= followed by the public key.
- A 2048-bit record is longer than the 255 characters that one DNS string can hold, so the tool also shows the value cut into quoted strings of 255 characters or fewer, which DNS providers that ask for split strings expect.

## Where the pieces go

There are two places to put what this page gives you. The TXT record goes into the DNS zone of your domain, with the host name shown on the page, which in most DNS dashboards is entered as just the selector and ._domainkey because the dashboard adds the domain for you. The private key goes into the platform that signs your mail, together with the selector and the domain.

RFC 6376 describes how a receiver finds the key: it takes the d= domain and the s= selector from the signature and looks up a TXT record at the selector, then ._domainkey, then the domain. If the record is missing or the selector does not match, the signature cannot be checked and DKIM fails.

## Key size

RFC 6376 says signers must use RSA keys of at least 1024 bits for long-lived keys and that verifiers must be able to check keys from 512 to 2048 bits. Google's setup guide offers 2048 bits when your DNS provider supports it and 1024 bits when it does not, and notes that longer keys are more secure. This tool makes 2048-bit keys, the longer of those two choices.

The cost of a longer key is a longer DNS record. That is why the value has to be cut into strings: DNS stores text in strings of up to 255 characters each, and RFC 1035 describes the length byte that sets that limit. RFC 6376 itself shows a record split into several quoted pieces.

## Rotation and good habits

Keys should be replaced from time to time. Make a new pair with a new selector, publish its record, switch your sending system to the new key, and remove the old record after mail signed with the old key has had time to be delivered and read. Putting the date in the selector name tells you at a glance how old a key is.

Treat the private key like a password. Anyone who holds it can sign messages that pass DKIM for your domain. Store it in your sending platform's key settings or a secrets manager, and do not paste it into chat or email.

After publishing, wait for DNS to update, send a test message to a mailbox at another provider, and read the headers with the header analyzer. A line saying dkim=pass with your domain means signing works.

## Worked example

Input:

```
Selector: s202610
Domain: example.com
(The public key below was made once for this example and its private half was not kept. Generate your own.)
```

Result:

```
Host: s202610._domainkey.example.com

TXT value:
v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu8Q53ZQOalB2eo0iebmOoFASRIJ8AS7LNm9+0O/m9XQNne5BO2IZLbdpvtePq0/nvMM9uBzJl2H+hVPRBber6R8eJ69wt7HTdCLIjL9ayC86RgScqfmSwdwGaDFEzWXn+avN3RQ/GDOoTfoIRnoUKSfw+K/xXBV2Y9TGay8RbE7tDBGt96OEWxw3FUYFZQg40UJGsK48iw9M5RK5egmjzFbEuE036qLi3CaBY0aKeMu2aMuU/5pXMgHfLU2yi3bcPBsyUptd8/juo14UIsMLnfTnjoo/J7lWV6eMiTq/iMpZUSped1CqH58G6h8wa8YrM/xtRDsfNiK48eB079ZU4wIDAQAB

Split into 2 strings of at most 255 characters:
1. 255 characters
2. 155 characters

"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu8Q53ZQOalB2eo0iebmOoFASRIJ8AS7LNm9+0O/m9XQNne5BO2IZLbdpvtePq0/nvMM9uBzJl2H+hVPRBber6R8eJ69wt7HTdCLIjL9ayC86RgScqfmSwdwGaDFEzWXn+avN3RQ/GDOoTfoIRnoUKSfw+K/xXBV2Y9TGay8RbE7tDBGt96OEWxw3FUYFZQg40" "UJGsK48iw9M5RK5egmjzFbEuE036qLi3CaBY0aKeMu2aMuU/5pXMgHfLU2yi3bcPBsyUptd8/juo14UIsMLnfTnjoo/J7lWV6eMiTq/iMpZUSped1CqH58G6h8wa8YrM/xtRDsfNiK48eB079ZU4wIDAQAB"
```

## Limits

- Some sending platforms make their own keys and give you only the DNS record to publish. If yours does, use the record it gives you and not a key from this page.
- The private key is shown once. If you close the page without saving it, generate a new pair and publish a new record.
- The key is a PKCS8 PEM block headed PRIVATE KEY. A few older systems want the PKCS1 form headed RSA PRIVATE KEY, and need a conversion step.
- A few DNS providers do not accept TXT values longer than 255 characters in one string, or silently drop the quotes. Use the split version if yours complains.
- Publishing the record does not turn signing on. The sending system must be set up with the private key and the same selector.

## Questions

**Is it safe to generate a DKIM key in a web page?**

Here the key is made by your own browser and stays on your device. The page contains no code that sends it anywhere, and you can confirm that by disconnecting from the internet after the page loads: key generation should still work.

**What selector should I use?**

Any name made of letters, digits, hyphens and underscores. A date such as s202610 works well because it shows the key's age and gives you a fresh name each time you rotate.

**Why is the record split into several quoted strings?**

A single DNS string holds at most 255 characters, and a 2048-bit record is longer. DNS joins the strings back together when a receiver reads them. Some providers do the splitting for you, and others need the split version.

**Where does the private key go?**

Into the system that sends your mail, in its DKIM or signing settings, with the same selector and domain. Never publish it in DNS or on a web page.

**Should I use 1024 or 2048 bits?**

Use 2048 if your DNS provider accepts the longer record. Google's guide offers 1024 only for hosts that cannot store 2048-bit keys.

**How do I check that it works?**

Once the record has propagated, send a message through your signing system to another provider, open its headers and look for dkim=pass. The DKIM checker linked below can also read the published record.

## Sources

- [RFC 6376: DomainKeys Identified Mail (DKIM) Signatures](https://datatracker.ietf.org/doc/html/rfc6376) (read 2026-10-18)
- [RFC 1035: Domain names, implementation and specification (character strings)](https://www.rfc-editor.org/rfc/rfc1035.txt) (read 2026-10-18)
- [Google Workspace Admin Help: Set up DKIM (key length options)](https://support.google.com/a/answer/174124?hl=en) (read 2026-10-18)
- [W3C Web Cryptography API (RSASSA-PKCS1-v1_5, spki and pkcs8 export formats)](https://www.w3.org/TR/WebCryptoAPI/) (read 2026-10-18)

## Related tools

- [DKIM checker](https://coldagentai.com/tools/dkim-checker.md)
- [spf-generator](https://coldagentai.com/tools/spf-generator.md)
- [dmarc-generator](https://coldagentai.com/tools/dmarc-generator.md)
- [List-Unsubscribe generator](https://coldagentai.com/tools/list-unsubscribe-generator.md)
- [SPF checker](https://coldagentai.com/tools/spf-checker.md)

## Related

- [Free cold email tools](https://coldagentai.com/tools.md)
- [DKIM Checker: Find and Test a DKIM Record](https://coldagentai.com/tools/dkim-checker.md)
- [SPF record generator](https://coldagentai.com/tools/spf-generator.md)
- [DMARC record generator](https://coldagentai.com/tools/dmarc-generator.md)
- [List-Unsubscribe header generator](https://coldagentai.com/tools/list-unsubscribe-generator.md)
- [SPF Checker with Lookup Tree and Lookup Count](https://coldagentai.com/tools/spf-checker.md)
