Free tool
DKIM Record Generator
Turn a selector, domain and public key into a DKIM TXT record, split into 255-character strings.
How it works
What is the DKIM Record Generator?
The DKIM Record Generator is a free tool that formats a DKIM DNS record from a public key. Enter the selector, the domain and the key, as PEM or bare base64, and it returns the TXT record name and the v=DKIM1 value, also split into 255-character strings. It does not create keys; it shows the OpenSSL commands that do.
How to use the DKIM Record Generator
- Create a key pair with the OpenSSL commands shown under the tool, or export the public key from your mail server.
- Enter the selector your mail server signs with, and your domain.
- Paste the public key, with or without its BEGIN and END lines.
- Copy the record name and value into a TXT record at your DNS host.
What is a DKIM record?
DKIM (DomainKeys Identified Mail) signs each outgoing message with a private key held by the sending server. The matching public key is published in DNS, and a receiver uses it to confirm that the message was signed by the domain and was not altered on the way.
The DKIM record is the TXT record that holds that public key. It looks like v=DKIM1; k=rsa; p= followed by the key in base64. This tool writes that value from the key you paste.
What is a DKIM selector?
A selector is a label that lets one domain publish several DKIM keys. The record lives at selector._domainkey.example.com, and every signed message names the selector in its DKIM-Signature header (the s= tag) so the receiver knows which key to fetch.
You choose the selector yourself when you run your own mail server; a date such as mail2026 makes later key rotation easy to follow. With a hosted service the selector is assigned by the service, and you must use exactly the name it gives you.
How do I generate a DKIM key pair?
With OpenSSL, two commands create a 2048-bit RSA pair: openssl genrsa -out dkim_private.pem 2048, then openssl rsa -in dkim_private.pem -pubout -out dkim_public.pem. The private file goes into your mail server's DKIM signing configuration and never leaves it. The public file is what you paste here.
This tool deliberately does not create keys, because a private key should be made on the machine that will use it. If you paste a private key by mistake, the tool refuses to build a record and tells you. Hosted email services create the pair for you and show only the record to publish.
Why is a DKIM record split into several strings?
A single string inside a TXT record can hold at most 255 characters, and a 2048-bit key makes the value about 400 characters long. The fix is one TXT record made of several quoted strings, which resolvers join back together with nothing in between.
Most DNS dashboards do the splitting for you, so paste the single-line value first. Use the split version where the host asks for quoted strings, for example in a BIND zone file. Never create two separate TXT records for the two halves.
What DKIM key size should I use?
2048-bit RSA is the standard choice. RFC 8301 requires at least 1024 bits and recommends 2048 or more, and 1024-bit keys are considered weak today. 4096-bit keys are valid, but the record becomes long enough that some DNS hosts reject it.
The tool recognises 1024, 2048 and 4096-bit RSA keys from the way the encoded key begins and labels the output. It does not verify the key beyond that, and it does not check DNS. After publishing, confirm that the record is live by looking up the selector name with the DNS Lookup, then add a policy with the DMARC Record Generator.
Questions
- What do I enter as the record name?
- The full name is
selector._domainkey.yourdomain.com. Many DNS hosts add the domain themselves, so there you enter onlyselector._domainkey. - Does this tool work with Ed25519 keys?
- No. It writes
k=rsarecords only. Ed25519 DKIM keys usek=ed25519and a different key encoding, and not every receiver verifies them yet. - Is it safe to paste my key here?
- A public key is meant to be published, so yes. Never paste a private key into any website. This tool detects one and refuses to output a record.
- Do I also need SPF if I have DKIM?
- Publish both. DMARC passes when either one passes and aligns with the From domain, and having both covers forwarding and misconfiguration. Build SPF with the SPF Record Generator.
- Is the DKIM Record Generator free?
- Yes, with a free spyc.ai account. It runs in your browser, so nothing you type or paste is sent to a server.
Email and DNS Tools
More in Email and DNS Tools
DNS Lookup
See the A, AAAA, CNAME, MX, NS, TXT, SOA and CAA records a domain publishes, with TTLs for its addresses.
Look up DNSMX Record Checker
List a domain's mail servers by priority with their IPs and likely provider, and see if SPF and DMARC exist.
Check MX recordsEmail Blacklist Checker
Check a domain's mail server IPs, or one IPv4 address, against five public spam blocklists.
Check blacklistsReady when you are
Before your next buyer asks AI about you, ask AI about yourself
One check, four engines, about twenty seconds. We show you the answers before we ask for anything.