Home › Developer Tools › DKIM Record Generator

DKIM Record Generator

Generate a fresh RSA key pair for DKIM email signing, entirely in your browser. You get the TXT record to publish at selector._domainkey, a zone-file version split into 255-character strings, and the private key as a PEM file for your mail server.

Last updated:

Any short name. A date-based selector makes key rotation easy.

Key size (RSA)
Record options

Keys are created with your browser's Web Crypto API and never leave this page.

1. DNS TXT record

Type
TXT
Host / Name
Value
TTL
3600 (or your host's default)
Zone file format (split into 255-character strings)

          
        

2. Private key (keep secret)

Install it on your mail server or signing service. Anyone with this key can sign mail as your domain.

3. Public key

OpenDKIM config lines


      
Advertisement
Advertisement

How to use the DKIM Record Generator

  1. Enter your domain and a selector (or keep the date-based default).
  2. Pick the key size: 2048-bit unless your DNS host cannot store long TXT records.
  3. Click Generate DKIM keys and download the private key right away.
  4. Publish the TXT record at your DNS host with the shown host name and value.
  5. Configure your mail server to sign with the private key and selector, then send a test email and verify it with the DKIM Record Checker.

Setting up DKIM step by step

  1. Generate the key pair above and save the private key file somewhere only the mail server can read (for example permissions 600, owned by the opendkim user).
  2. Publish the public key as a TXT record at selector._domainkey.yourdomain. Wait for the TTL and confirm it with the DKIM Record Checker.
  3. Configure signing on your server with the same domain and selector (OpenDKIM KeyTable and SigningTable lines are shown above).
  4. Send a test message to a mailbox you control and open its headers: look for dkim=pass in the Authentication-Results header.
  5. Add SPF and DMARC so receivers can enforce your policy, using the SPF Record Generator and DMARC Record Generator.

Key size and record length

KeyBase64 public keyTXT value (approx.)Status
RSA 1024-bit216 charactersabout 235 characters, fits in one stringMinimum allowed, considered weak
RSA 2048-bit392 charactersabout 410 characters, two stringsRecommended (RFC 8301)
RSA 4096-bit736 charactersabout 755 characters, three stringsVerifiers are not required to support it

The selector is only a label. Something like s202610 (year and month) tells you at a glance how old a key is and lets you publish the next key under a new name without touching the current one.

Frequently asked questions

What does a DKIM record generator create?

Two things: a private key that your mail server uses to sign outgoing messages, and a DNS TXT record containing the matching public key. Receivers look up the TXT record at selector._domainkey.yourdomain to verify the signatures. Both halves must come from the same key pair.

Are the keys generated securely?

Yes. The key pair is created by your browser's built-in Web Crypto API, which uses the operating system's cryptographically secure random number generator. The keys never leave the page, are not stored anywhere and disappear when you close the tab, so download the private key before leaving.

Should I use a 1024-bit or 2048-bit key?

Use 2048 bits. RFC 8301 recommends at least 2048-bit RSA keys for signers, and large mailbox providers advise the same. Choose 1024 bits only if your DNS provider cannot publish TXT records longer than 255 characters, and plan to move to 2048 later.

What host name do I enter at my DNS provider?

Enter selector._domainkey as the host or name, for example s202610._domainkey. Many dashboards add your domain automatically; if yours asks for the full name, use s202610._domainkey.example.com. The record type is TXT and the value is the v=DKIM1 string.

Why is the record split into several strings?

A single character string in a DNS TXT record is limited to 255 characters, and a 2048-bit DKIM value is about 410 characters. In zone files it is written as several quoted strings in parentheses, which verifiers join back together. Most web dashboards accept the full value and split it for you.

Do I need this if I use Google Workspace or Microsoft 365?

Usually not. Hosted email services generate their own DKIM keys: Google Workspace gives you a TXT value in the Admin console, and Microsoft 365 asks you to publish two CNAME records. This generator is for self-hosted mail servers (Postfix with OpenDKIM, Exim, Haraka and others) and services that let you bring your own key.

How often should I rotate DKIM keys?

A common practice is every 6 to 12 months. Publish a new selector with a new key, switch your server to sign with it, wait a few days, then replace the old record's p= value with an empty one to revoke it. Date-based selectors make this easy to track.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

DKIM Record CheckerLook up a domain's DKIM key by selector (or auto-detect), check key type, bit length and tags.SPF Record GeneratorBuild a valid SPF TXT record from mail providers, IPs and includes, with a lookup-count check.DMARC Record GeneratorCreate a DMARC TXT record with policy, reporting and alignment options, every tag explained.RSA Key GeneratorGenerate 2048, 3072 or 4096-bit RSA key pairs as PEM, PKCS#1, JWK or OpenSSH, locally.Email ValidatorCheck email lists and spot disposable addresses.Website Down CheckerCheck if a website is down for everyone.Deep Link GeneratorCreate links that open directly in apps.URL ParserBreak a URL into its parts and edit query string parameters with a live rebuild.User Agent ParserSee your user agent and parse any UA string into browser, OS, engine and device.HTTP Status CodesSearch every HTTP status code with plain-English meanings, causes, fixes and RFC references.Subnet CalculatorCalculate IPv4 network, broadcast, host range, masks and host count, and split subnets.Bulk URL OpenerOpen a list of URLs in new tabs at once or in batches, with cleanup, dedupe and delay.DNS LookupLook up A, AAAA, MX, TXT, NS, CNAME, SOA and CAA records with TTLs over secure DNS.API Request TesterSend GET, POST, PUT and DELETE requests with headers and a body, then inspect the response.WebSocket TesterConnect to a ws:// or wss:// server, send messages and watch a timestamped live log.WHOIS LookupLook up who registered a domain or IP: registrar, creation and expiry dates, name servers, status.Mailto Link GeneratorBuild encoded mailto: links with cc, bcc, subject and body, plus HTML code and a QR code.WhatsApp Link GeneratorCreate wa.me click-to-chat links with a pre-filled message, button HTML and a QR code.Basic Auth Header GeneratorCreate an Authorization: Basic header from a username and password, or decode one.Common Ports ListSearchable TCP/UDP port number list with service, protocol and description, filterable by range.DMARC CheckerLook up a domain's DMARC record, explain every tag, grade the policy and get fix suggestions.Email Header AnalyzerPaste raw email headers to trace every server hop, see delays and check SPF, DKIM and DMARC.IP Geolocation LookupFind the country, city, ISP, ASN and time zone of any IP address or domain, with a map.Reverse DNS LookupFind the PTR hostname of any IPv4 or IPv6 address, one at a time or hundreds in bulk.SPF Record CheckerLook up a domain's SPF record, count nested DNS lookups, find errors and test a sender IP.CIDR to IP RangeConvert IPv4 or IPv6 CIDR blocks to first/last IP, mask and host count, and export IP lists.DNS Propagation CheckerCompare DNS answers and TTLs from Cloudflare, Google, Quad9, AdGuard and NextDNS side by side.Domain Availability CheckerCheck if domain names are available across .com, .io, .ai and more, with registrar and expiry.MAC Address LookupFind the vendor of a MAC address or OUI, check multicast and random bits, look up many at once.MX LookupFind a domain's mail servers: MX priority, host, IP addresses and the email provider.Uptime SLA CalculatorTurn 99.9% uptime into allowed downtime per day, month and year, or downtime into uptime %.Website Speed TestTest page speed with Lighthouse: performance score, Core Web Vitals and fixes, mobile or desktop.ASN LookupLook up an AS number or IP: network owner, country, registry, abuse contact and announced prefixes.Bandwidth CalculatorEstimate monthly website bandwidth (GB) and the Mbps you need from page views and page size.CNAME LookupFollow a hostname's full CNAME chain to its final IP addresses, with TTLs and CDN detection.CORS TesterSend GET, POST or OPTIONS from your browser to any API and see whether CORS allows it and why not.DMARC Report AnalyzerRead DMARC aggregate XML reports (.xml, .gz, .zip): sources, SPF/DKIM alignment and pass rates.Domain Age CheckerSee how old a domain is, when it was registered and when it expires. Bulk check up to 50.Email PermutatorGenerate every common business email format from a first name, last name and company domain.HTTP Header ParserPaste raw HTTP headers to get a table explaining each one plus a security headers grade.IP Blacklist CheckerCheck an IPv4 address against 21 public spam blocklists (DNSBLs) and see listed or clean.IP Range to CIDRTurn a start and end IP into the shortest list of CIDR blocks, for IPv4 and IPv6.IPv6 Subnet CalculatorIPv6 prefix to network, range, address count and /64s, and split it into child subnets.Link in Bio Page GeneratorCreate a link-in-bio page with avatar, bio, links and theme, then download it as one HTML file.NS LookupFind a domain's authoritative nameservers with their IPs, SOA record and DNS hosting provider.Social Share Link GeneratorMake share links and buttons for Facebook, X, LinkedIn, Reddit, Pinterest, WhatsApp and email.Subnet Mask Cheat SheetInteractive /0 to /32 table of subnet masks, wildcards and host counts with details per prefix.TXT Record LookupLook up a domain’s DNS TXT records and see which are SPF, DMARC, DKIM or verification tokens.VLSM CalculatorSplit a network into variable-length subnets sized to the hosts each one needs.YouTube Timestamp Link GeneratorMake YouTube links that start at a set time, embed start/end codes and lists of timestamps.Email Deliverability CheckerGrade a domain's MX, SPF, DMARC, DKIM, BIMI and MTA-STS records in one report with fixes.Email ObfuscatorHide an email address from spam bots with HTML entities, a JavaScript mailto link or reversed CSS text.
See all 52 Network, DNS & Email Tools →