DKIM Record Generator
Create the correct DKIM DNS host name and TXT record format for your domain and selector. Paste your public key and publish.
Generate Your DKIM DNS Record Format
Common values: mail, google, s1, default. Use the selector your mail provider specifies.
What Is DKIM and How Does It Work?
DKIM (DomainKeys Identified Mail) is an email authentication method that allows the sender to cryptographically sign each outgoing message. The receiving mail server verifies this signature using a public key published in the sender's DNS. A valid DKIM signature proves two things: the message actually came from the stated domain, and the message was not altered in transit.
Unlike SPF, which checks the sending IP against an allowed list, DKIM works by attaching a digital signature to the message itself. This means DKIM verification survives mail forwarding, where SPF often fails because the forwarding server's IP is not in the original SPF record.
Understanding the DKIM DNS Record Format
A DKIM record is a DNS TXT record published at a specific subdomain: selector._domainkey.yourdomain.com. The selector is a label you choose β common values are mail, google, s1, or default. The record value starts with v=DKIM1; k=rsa; p= followed by your base64-encoded public key.
The private key is kept secret on your mail server or managed by your email service provider. The public key is what you publish in DNS. Receiving servers use the public key to verify signatures created by the private key β the classic public-key cryptography pattern.
Where to Find Your DKIM Public Key
Your DKIM public key is generated by your mail provider when you enable DKIM signing. Here is where to find it for the most common providers:
- Google Workspace: Admin console β Apps β Google Workspace β Gmail β Authenticate email. Generate a new key and copy the TXT record value.
- Microsoft 365: Exchange admin center β Protection β DKIM. Enable DKIM for your domain and copy the CNAME records (Microsoft uses CNAMEs, not direct TXT records).
- Mailchimp: Account β Domains β Verify a domain. Mailchimp provides the DKIM TXT record value to add to your DNS.
- SendGrid: Settings β Sender Authentication β Domain Authentication. SendGrid generates the full DKIM TXT record for you.
- Self-hosted (Postfix, Exim): Use opendkim-genkey to generate a key pair. The public key file contains the TXT record value.
DKIM Best Practices
Use a 2048-bit key length when possible β 1024-bit keys are considered weak and may be flagged by some mail systems. Rotate your DKIM keys periodically (at least annually) to limit exposure if a key is ever compromised. Keep the old key in DNS for a few days after rotating to allow in-flight messages to be verified.
DKIM alone does not protect the visible From header. To complete your email authentication setup, add a DMARC policy that aligns DKIM results with the From domain. A clean email list also matters β even authenticated mail lands in spam if it bounces repeatedly. Use email verification to remove invalid addresses, or verify large lists with bulk email verification.
Frequently Asked Questions
1. What is a DKIM selector?
A DKIM selector is a short name (such as mail or google) that points to a specific public key in DNS. It lets you publish multiple keys for the same domain β for example one for Google Workspace and another for a marketing ESP.
2. Where do I publish the DKIM TXT record?
Publish it as a TXT record at selector._domainkey.yourdomain.com. Replace selector with the value your provider gave you and yourdomain.com with your sending domain.
3. Why does DKIM survive forwarding better than SPF?
SPF checks the connecting IP. After a forward, the connecting IP changes and SPF often fails. DKIM signs the message content and selected headers, so verification still works after many forwards.
4. Should I use 1024-bit or 2048-bit DKIM keys?
Prefer 2048-bit keys when your DNS provider supports long TXT values. Some older DNS hosts require splitting long records; most modern providers handle 2048-bit keys fine.
5. Does DKIM replace SPF?
No. Use both. SPF authorizes sending IPs; DKIM signs messages. DMARC then aligns those results with the From domain and tells receivers what to do on failure.
6. How do I know DKIM is working?
Send a test message to a mailbox you control, open the raw headers, and look for dkim=pass in Authentication-Results. You can also use our Email Header Analyzer tool.
Explore More Features
Discover all our verification tools
Verify and clean your email list
Authentication protects your domain. Clean lists protect your reputation. BillionVerify verifies addresses with SMTP-level accuracy.
100 free verifications daily Β· 99.9% SMTP accuracy Β· Instant API access Β· No credit card required