Back to Tools

DKIM Record Generator

Generate a valid DKIM DNS record for your domain. Choose your key type (RSA or Ed25519), set a selector, paste your public key, and get a ready-to-use TXT record with key generation commands.

About this tool

DKIM (DomainKeys Identified Mail) adds a cryptographic signature to every outgoing email, proving it actually came from your domain and wasn't altered in transit. As of February 2024, Gmail and Yahoo require DKIM for any sender doing more than 5,000 emails per day. Without it, your messages either bounce or land in spam. This generator creates the DNS TXT record you need to publish your DKIM public key — just pick your key type, set a selector name, paste your public key, and copy the record.

RSA vs Ed25519: which key type should you use?

RSA-2048 is the safe default. Every major mail provider supports it, and it's been the industry standard for over a decade. The downside is that RSA keys are long — a 2048-bit public key produces a DNS TXT record around 400 characters, which can cause issues with DNS providers that limit record length. Ed25519 is the modern alternative: keys are dramatically shorter (just 44 characters for the public key), signing is faster, and the cryptography is actually stronger. The catch is that a small percentage of older receiving servers don't verify Ed25519 signatures yet. The best approach? Set up both. Use Ed25519 as your primary and RSA as a fallback. Most mail servers will try Ed25519 first and fall back to RSA automatically.

Key generation and selector naming

For RSA-2048, run openssl genrsa -out private.pem 2048 followed by openssl rsa -in private.pem -pubout -out public.pem. For Ed25519, use openssl genpkey -algorithm ed25519 -out private.pem and openssl pkey -in private.pem -pubout -out public.pem. Your selector name identifies which key to use — the DNS lookup follows the pattern selector._domainkey.yourdomain.com. Use descriptive selectors like google for Google Workspace, sg2024 for SendGrid, or seq for Sequenzy. Avoid generic names like default because they make it harder to rotate keys or track which service uses which key.

Why DKIM matters for deliverability

DKIM is one of three pillars of email authentication, alongside SPF and DMARC. Together they form the trust triangle that mailbox providers use to decide whether your email reaches the inbox. DKIM carries the most weight in deliverability scoring — it's worth 25 points in most reputation models compared to 20 for SPF. That's because DKIM survives forwarding, while SPF breaks when an email is relayed through an intermediate server. In practice, emails with valid DKIM signatures see 10-15% better inbox placement rates than unsigned emails from the same domain.

Setting up and verifying your record

After generating your record with this tool, add it as a TXT record in your DNS provider. Keep in mind that DNS propagation can take up to 48 hours, though most providers update within 15-30 minutes. Use our DNS propagation checker to monitor the rollout, then verify the record is correct with our DKIM checker. Once DKIM is live, set up DMARC to tell receiving servers what to do when authentication fails. Finally, run a deliverability score check to see your overall authentication grade.

Frequently Asked Questions

What is a DKIM record?

A DKIM record is a DNS TXT record that publishes your public key. When you send an email, your mail server signs the message headers and body with the corresponding private key. The receiving server looks up the public key via DNS, verifies the signature, and confirms the email is authentic and unmodified. The record lives at selector._domainkey.yourdomain.com.

Should I use RSA or Ed25519 for DKIM?

RSA-2048 is the safest choice for universal compatibility — it works with every major email provider. Ed25519 is newer, produces much shorter keys (44 vs ~400 characters), and is cryptographically stronger, but roughly 5-10% of older receiving servers don't support it yet. Ideally, configure both: Ed25519 as primary with RSA as fallback. Most mail servers try the preferred algorithm first and fall back automatically.

What is a DKIM selector and how should I name it?

A selector identifies which DKIM key to use for a given email. It lets you have multiple keys for different services — for example, 'google' for Google Workspace, 'sg2024' for SendGrid, or 'seq' for Sequenzy. The full DNS lookup is selector._domainkey.yourdomain.com. Use descriptive, service-specific names and include the year if you plan to rotate keys annually (e.g., 'marketing2025').

How do I generate a DKIM key pair?

For RSA-2048, run 'openssl genrsa -out private.pem 2048' then 'openssl rsa -in private.pem -pubout -out public.pem'. For Ed25519, run 'openssl genpkey -algorithm ed25519 -out private.pem' then 'openssl pkey -in private.pem -pubout -out public.pem'. The tool provides copy-ready commands for both key types. Keep your private key secure — never share it or commit it to version control.

How long does it take for a DKIM record to work?

After adding the TXT record to your DNS, propagation typically takes 15-30 minutes but can take up to 48 hours depending on your DNS provider and TTL settings. Use a DNS propagation checker to monitor rollout across global nameservers. Don't send important campaigns until you've verified the record is resolving correctly.

What happens if my DKIM record is wrong?

If the public key in DNS doesn't match the private key your server uses to sign, DKIM verification fails. Depending on your DMARC policy, this could mean emails get quarantined (sent to spam) or rejected entirely. Common mistakes include extra whitespace in the key, missing the 'v=DKIM1' tag, or using the wrong selector name. Always verify with a DKIM checker after setup.

How often should I rotate DKIM keys?

Best practice is to rotate DKIM keys every 6-12 months. Key rotation limits the damage if a private key is compromised. Use dated selectors (like 'marketing2025') so you can publish the new key, update your mail server, verify it works, and then remove the old DNS record. Never delete the old record before your mail server switches to the new key.

Can I have multiple DKIM records for one domain?

Yes — that's exactly what selectors are for. You can have separate DKIM keys for your marketing platform, transactional email service, Google Workspace, and any other service that sends email on your behalf. Each gets its own selector and DNS record. There's no practical limit to how many you can have.