# DKIM record generator

> Makes a DKIM key pair in your browser and writes the TXT record to publish. Free, no signup. Runs in your browser. Nothing you type is sent to us.

**DKIM record generator. A new DKIM key and its DNS record, in seconds, no signup.** Use it at https://tools.joinvalley.co/dkim-record-generator

## What goes in a DKIM record? Every tag RFC 6376 defines, and which you need.

A DKIM record is a TXT record at selector._domainkey.yourdomain that publishes the public key receivers use to check your signatures. Only p=, the key itself, is required; v=DKIM1 and k=rsa are the usual companions, and an empty p= means the key has been revoked.

| Tag | What it holds | Required? | Default |
| --- | --- | --- | --- |
| v= | Version. If present it must be DKIM1, and first. | No, recommended | DKIM1 |
| k= | Key type | No | rsa |
| p= | The public key, base64. Empty means revoked. | Yes | None |
| h= | Hash algorithms the key may be used with | No | All |
| s= | Service types the key applies to | No | * (all) |
| t= | Flags: y means testing, s means i= must match d= exactly | No | None |

This generator writes v=DKIM1; k=rsa; p= and nothing else, which is what most mail servers expect.

Sources: [RFC 6376: DomainKeys Identified Mail (DKIM) Signatures](https://www.rfc-editor.org/rfc/rfc6376) (read 2026-11-09)

## How it works

Type your domain, pick a selector and a key size, and generate. Your browser makes an RSA key pair with the Web Crypto API; nothing is sent to us, and the private key exists only in this tab until you save it.

You get the record's host name, selector._domainkey, the TXT value, the same value split into quoted strings of at most 255 characters for DNS hosts and zone files that need it, and the private key as a PEM file for your mail server.

2048 bits is the default because RFC 8301 says signers should use at least 2048-bit keys. Choose 1024 only if your DNS host can't store the longer record; RFC 8301 sets 1024 as the minimum.

What it can't do is publish the record or install the key: those happen at your DNS host and your mail server. Once the record is live, the SPF, DKIM and DMARC checker reads it back.

## Set up a DKIM key without breaking mail. Four things the RFCs and providers say.

DKIM is simple once you know where each half of the key goes.

### Check whether you need a key at all

Google Workspace generates DKIM keys in the Admin console, with google as the default selector and 2048 bits recommended. Microsoft 365 generates two key pairs itself and asks you to publish CNAME records at selector1._domainkey and selector2._domainkey. A generated key is for your own mail server, or a service that asks you to bring one.

Sources: [Google Workspace Help: Set up DKIM](https://knowledge.workspace.google.com/admin/security/set-up-dkim) (read 2026-11-09), [Microsoft Learn: How to use DKIM for email in your custom domain](https://learn.microsoft.com/en-us/defender-office-365/email-authentication-dkim-configure) (read 2026-11-09)

### Use 2048 bits

RFC 8301 says signers must use RSA keys of at least 1024 bits and should use at least 2048, and receivers must be able to verify keys from 1024 to 4096 bits. It also retired rsa-sha1, so signatures need sha256.

Sources: [RFC 8301: Cryptographic Algorithm and Key Usage Update to DKIM](https://www.rfc-editor.org/rfc/rfc8301) (read 2026-11-09)

### Long records and the 255-character limit

A single string in a DNS TXT record holds at most 255 characters, and a 2048-bit DKIM record is longer. The fix is several quoted strings in one record: RFC 6376 says receivers join them with no whitespace in between. Some DNS hosts split it for you; for the rest, paste the split value.

Sources: [RFC 1035: Domain names, implementation and specification](https://www.rfc-editor.org/rfc/rfc1035) (read 2026-11-09), [RFC 6376: DomainKeys Identified Mail (DKIM) Signatures](https://www.rfc-editor.org/rfc/rfc6376) (read 2026-11-09)

### Rotate with a new selector

Selectors exist so a domain can have several keys at once. RFC 6376 advises giving new keys new selectors rather than reusing old ones: publish the new key under a new selector, switch the mail server to it, then revoke the old one with an empty p=.

A signed message proves it's from you. Whether anyone replies depends on who it's to. [Valley](https://www.joinvalley.co/?utm_source=tools_suite)

Sources: [RFC 6376: DomainKeys Identified Mail (DKIM) Signatures](https://www.rfc-editor.org/rfc/rfc6376) (read 2026-11-09)

## Sources

- [RFC 6376: DomainKeys Identified Mail (DKIM) Signatures](https://www.rfc-editor.org/rfc/rfc6376) (read 2026-11-09)
- [RFC 8301: Cryptographic Algorithm and Key Usage Update to DKIM](https://www.rfc-editor.org/rfc/rfc8301) (read 2026-11-09)
- [RFC 1035: Domain names, implementation and specification](https://www.rfc-editor.org/rfc/rfc1035) (read 2026-11-09)
- [Google Workspace Help: Set up DKIM](https://knowledge.workspace.google.com/admin/security/set-up-dkim) (read 2026-11-09)
- [Microsoft Learn: How to use DKIM for email in your custom domain](https://learn.microsoft.com/en-us/defender-office-365/email-authentication-dkim-configure) (read 2026-11-09)

## Questions people ask

### What is a DKIM record?

A DNS TXT record at selector._domainkey.yourdomain that publishes the public key receivers use to verify your messages' DKIM signatures.

### How do I generate a DKIM key?

Type your domain and a selector here and click generate. Your browser makes the key pair; publish the TXT record and put the private key in your mail server.

### What DKIM key size should I use?

2048 bits. RFC 8301 says signers should use at least 2048-bit RSA keys, and must use at least 1024.

### What is a DKIM selector?

The name that picks one key out of several for the same domain, like s1 or google. It's in each signature's s= tag and in the record's host name.

### Where do I put the DKIM record?

At your DNS host, as a TXT record named selector._domainkey on your domain, for example s1._domainkey.acme.com.

### Do I need a DKIM generator for Google Workspace or Microsoft 365?

No. Google generates the key in the Admin console, and Microsoft 365 generates its own keys and gives you two CNAME records to publish.

### How do I split a long DKIM record?

Break the value into quoted strings of at most 255 characters each, in one TXT record. Receivers join them with no spaces. This page gives you the split value.

### How do I revoke a DKIM key?

Publish the record with an empty p= value. RFC 6376 says an empty p= means the key has been revoked.

### Is my private key safe here?

It's made by your browser's Web Crypto API and never sent anywhere. We don't see it, and it's gone when you close the tab.

### Is this DKIM generator free?

Yes. It's free, needs no signup and runs in your browser.

## Related tools

- [SPF record generator](https://tools.joinvalley.co/spf-record-generator): Builds an SPF record and counts every DNS lookup, nested includes too, against 10.
- [DMARC record generator](https://tools.joinvalley.co/dmarc-record-generator): Writes a DMARC record to RFC 9989, with report addresses, alignment and test mode.
- [SPF, DKIM and DMARC checker](https://tools.joinvalley.co/spf-dkim-dmarc-checker): Checks a domain's SPF, DKIM and DMARC records against Gmail and Yahoo's sender rules.
- [Email setup map](https://tools.joinvalley.co/email-setup-map): Draws a domain's email setup as one diagram: MX, the SPF include tree, DKIM and DMARC.
- [Cold email domain finder](https://tools.joinvalley.co/cold-email-domain-finder): Sending domain ideas close to your brand, each checked against its registry.

## Next step

Want replies, not just clean copy? Valley finds buyers showing real buying signals and messages them across email and LinkedIn. [Valley](https://www.joinvalley.co/?utm_source=tools_suite)

Shelf: [04 Email outreach](https://tools.joinvalley.co/email-outreach)

---

Tools by Valley, made by [Valley](https://www.joinvalley.co/?utm_source=tools_suite). HTML version: https://tools.joinvalley.co/dkim-record-generator
