DKIM Guide: What It Is, How It Works, and How to Set It Up

The complete 2026 guide to verifying your emails, stopping tampering, and stopping domain impersonation.

Key Takeaways

  • DKIM (DomainKeys Identified Mail) uses cryptographic signatures to verify that an email was authorized by your domain and hasn't been altered during transit.
  • DKIM works alongside SPF and DMARC to create a complete email authentication framework that helps prevent spoofing, phishing, and unauthorized use of your domain.
  • A valid DKIM signature alone isn't enough for DMARC compliance. The signing domain must also align with the domain in the visible From address.
  • Setting up DKIM involves generating a key pair, publishing the public key in DNS, enabling email signing, and validating the configuration to ensure authentication works correctly.
  • Regular DKIM key rotation, monitoring, and validation help maintain strong email security and reduce the risk of authentication failures over time.
  • Using 2048-bit RSA keys, unique selectors for different email providers, and periodic audits are recommended best practices for maintaining a healthy DKIM deployment.

DKIM Explained

DKIM is one of the three core email authentication protocols, alongside SPF and DMARC. It uses cryptographic signatures to prove that an email was authorized by your domain and that its contents weren't modified during transit. This helps receiving mail servers distinguish legitimate messages from forged or tampered emails, improving both security and email deliverability.

In this guide, you'll learn what DKIM is, how it works, how to publish and validate DKIM records, troubleshoot common authentication issues, rotate signing keys, and understand how DKIM works together with SPF and DMARC to protect your domain.

Set up DKIM correctly

Generate keys, publish records, enable signing

Troubleshoot errors

Fix selectors, signatures & alignment

Align DKIM with DMARC

Make DKIM count toward DMARC

Free DKIM tools

Check, generate, and validate records

What Is DKIM?

DomainKeys Identified Mail (DKIM) is an email authentication protocol that uses public-key cryptography to verify that an email genuinely originated from your domain and wasn't modified after it was sent. Instead of relying solely on the sending server's IP address, DKIM attaches a unique digital signature to every outgoing email.

When a receiving mail server receives your message, it retrieves your public key from DNS and uses it to validate the signature. If the signature matches, the message passes DKIM authentication.

How DKIM Works

DKIM works by using a pair of cryptographic keys: a private key and a public key.

The private key stays securely on your outbound mail server or email service provider. Every time an email is sent, this private key generates a unique digital signature based on specific parts of the message, such as the body and selected headers. The signature is then added to the email as a DKIM-Signature header.

When the email reaches the recipient, their mail server extracts the signing domain and selector from the header, retrieves the corresponding public key from your DNS records, and verifies the signature.

If everything matches, DKIM passes. If the email was altered after signing or the signature cannot be verified, authentication fails.

DKIM Record Syntax Explained

A DKIM public key is published as a DNS TXT record. This record tells receiving mail servers how to verify the signature attached to your emails.

A basic DKIM record looks like this:

v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCA...

DKIM Selectors Explained

A DKIM selector identifies which public key should be used to validate a specific email signature.

Instead of publishing one DKIM key for an entire domain, organizations can create multiple selectors that point to different keys. This allows different email providers, applications, or departments to use separate signing keys without interfering with one another.

For example, your marketing platform might sign emails using one selector, while Microsoft 365 uses another. A typical selector looks like this: selector1._domainkey.example.com

  • selector1 is the selector.
  • _domainkey identifies the DKIM namespace.
  • example.com is the signing domain.

How to Set Up DKIM

Setting up DKIM involves generating a key pair, publishing the public key in DNS, and configuring your email service to sign outgoing messages using the corresponding private key.

The exact process varies slightly depending on your email provider, but the overall workflow remains the same.

  • Generate a DKIM key pair: Most email providers automatically generate a public/private key pair when you enable DKIM.
  • Publish the public key: Add the provided DKIM record to your domain's DNS as a TXT (or, in some implementations, CNAME) record.
  • Enable DKIM signing: Activate DKIM signing in your mail platform so every outgoing email includes a DKIM-Signature header.
  • Wait for DNS propagation: DNS updates typically propagate within a few hours, although some providers may take up to 48 hours.
  • Validate your configuration: Send a test email and verify that the DKIM signature passes authentication before moving to production.

Provider-specific setup guides

Need to generate a DKIM record?

PowerDMARC's free DKIM Record Generator creates a public/private key pair in seconds, helping you generate an accurate DKIM record that you can publish directly in your DNS. It supports recommended 2048-bit keys and eliminates the formatting errors that commonly cause DKIM authentication failures.

Start a free 15-day trial

How to Check and Validate DKIM

After publishing your DKIM record, the next step is to verify that it's working as expected. This means checking that your email service is generating DKIM signatures correctly and that receiving mail servers can successfully validate them.

A thorough DKIM validation should confirm that:

  • A DKIM record exists for the selected domain.
  • The selector resolves correctly.
  • The public key is valid.
  • Emails contain a DKIM-Signature header.
  • The signature passes verification.
  • DKIM aligns with your visible From domain for DMARC.

You can also inspect message headers manually in Gmail, Outlook, or Apple Mail to review DKIM authentication results.

Validate everything in a single scan

Instead of checking each element manually, you can verify your DKIM configuration in one pass. PowerDMARC's free DKIM Checker confirms that your DNS record is published correctly, validates your selector and public key, checks whether your emails are being signed, and highlights configuration issues that could affect authentication or deliverability.

Common DKIM Errors and How to Fix Them

Even when DKIM is configured, authentication failures can occur due to DNS misconfigurations, expired keys, incorrect selectors, or message modifications during transit. Most issues aren't caused by the DKIM protocol itself because many of them are the result of configuration drift or infrastructure changes.

Here's a quick overview of the most common DKIM errors and where to troubleshoot them:

ErrorWhat's HappeningFix Guide
No DKIM record foundThe receiving server couldn't locate your public key in DNS.No DKIM record found
Selector not foundThe email references a selector that doesn't exist in DNS.How to find a DKIM selector
DKIM signature is not validThe email was modified after signing or the signature is malformed.Fix DKIM signature is not valid
DKIM PermErrorA DNS or configuration problem prevents verification.How to fix DKIM PermError
DKIM noneThe email wasn't signed at all.DKIM none: message not signed
DKIM alignment failedThe signing domain doesn't align with the visible From address.Fix DKIM RFC 5322 alignment

If DKIM suddenly starts failing after changing email providers or updating DNS, verify that you're using the correct selector, that your public key has propagated successfully, and that your email platform is actively signing outgoing mail.

DKIM and DMARC Alignment

A successful DKIM signature doesn't automatically mean an email passes DMARC.

DMARC requires alignment, meaning the domain used to sign the email (the d= value in the DKIM signature) must match, or be an approved subdomain of, the domain shown in the visible From: address.

For example:

  • From: company.com
  • DKIM d=: company.com — Aligned
  • DKIM d=: mailservice.com — Not aligned

Even if the DKIM signature validates successfully, DMARC can still fail if the signing domain doesn't align with the From domain.

DMARC supports two alignment modes:

ModeDescription
Relaxed (adkim=r)Subdomains are considered aligned.
Strict (adkim=s)Domains must match exactly.

Many organizations rely on third-party email platforms for newsletters, transactional emails, or marketing campaigns. If these services sign messages using their own domain instead of yours, DKIM passes but DMARC fails due to misalignment.

Configuring custom DKIM signing for each provider helps ensure authentication succeeds consistently.

DKIM Key Lengths

The strength of DKIM depends largely on the cryptographic key used to sign your emails.

While 1024-bit RSA keys were once the standard, modern security recommendations favor 2048-bit RSA keys, which provide stronger protection against brute-force attacks and comply with current industry best practices.

Key LengthRecommendation
1024-bit RSALegacy. Supported by many providers but gradually being phased out.
2048-bit RSARecommended for most organizations.
Ed25519Newer algorithms offering stronger security with smaller key sizes where supported.

DKIM Key Rotation

Regular key rotation reduces the impact of a compromised private key and helps organizations maintain good email security hygiene.

A typical rotation process involves:

  • Generating a new key pair.
  • Publishing the new public key using a new selector.
  • Configuring your mail server to sign emails with the new selector.
  • Allowing sufficient time for previously signed emails to be delivered.
  • Removing the old selector from DNS.

Using selectors makes this transition seamless because both old and new keys can coexist during the migration period.

Organizations managing multiple domains or email providers often automate this process to reduce operational overhead and eliminate the risk of stale or forgotten DKIM keys.

DKIM vs SPF vs DMARC

SPF, DKIM, and DMARC are complementary protocols designed to solve different aspects of email authentication.

ProtocolPrimary Purpose
SPFVerifies that the sending server is authorized to send email for a domain.
DKIMVerifies that the email hasn't been altered after it was signed.
DMARCAligns SPF and DKIM with the visible From address and tells receivers how to handle failures.

Rather than choosing one protocol over another, organizations should deploy all three. For example:

  • SPF may fail when an email is forwarded.
  • DKIM often survives forwarding because the signature remains intact.
  • DMARC considers authentication successful if either SPF or DKIM passes and aligns with the From domain.

Together, they provide significantly stronger protection against spoofing, phishing, and impersonation attacks than any protocol can offer on its own.

Hosted DKIM

Managing DKIM across multiple email providers becomes increasingly complex as organizations grow.

Different marketing platforms, CRM systems, help desks, and transactional email services often require separate DKIM selectors, unique DNS records, and periodic key rotation.

Without centralized management, it's easy to lose track of:

  • Active selectors
  • Expired keys
  • Orphaned DNS records
  • Provider-specific signing configurations

Hosted DKIM simplifies this process by centralizing DKIM management, reducing manual DNS maintenance, and helping organizations maintain healthy authentication across all sending platforms.

Centralize DKIM across every sender

If you're managing DKIM across multiple domains or email providers, manual key rotation can quickly become difficult to maintain. PowerDMARC's Hosted DKIM lets you manage selectors, rotate signing keys, and update DKIM records from a centralized dashboard after a one-time DNS setup, reducing manual changes while helping maintain consistent authentication across your email infrastructure.

DKIM Best Practices

Following a few operational best practices can significantly improve both authentication reliability and long-term maintainability.

Use 2048-bit RSA keys
Provides stronger cryptographic protection.
Rotate keys regularly
Reduces the risk of compromised signing keys.
Use separate selectors for each provider
Simplifies management and troubleshooting.
Remove unused selectors
Reduces unnecessary attack surface.
Validate DKIM after DNS changes
Confirms signatures continue to verify correctly.
Monitor authentication regularly
Detects failures before they impact deliverability.
Pair DKIM with SPF and DMARC
Creates a complete email authentication framework.
Audit email infrastructure periodically
Identifies obsolete providers and stale DNS records.

Regular monitoring is just as important as the initial setup. Email providers change configurations, DNS records evolve, and new sending services are added over time. Periodic audits help ensure DKIM continues protecting your domain as your email infrastructure grows.

Strengthen Your Email Authentication with DKIM

DKIM plays a critical role in modern email authentication by allowing receiving mail servers to verify that your emails genuinely came from your domain and haven't been modified in transit. While it's an essential layer of protection against spoofing and phishing, DKIM is most effective when deployed alongside SPF and enforced through DMARC.

Whether you're configuring DKIM for the first time, troubleshooting authentication failures, or managing multiple email platforms, maintaining healthy DKIM records should be an ongoing process. Regular validation, key rotation, and monitoring help ensure your email authentication remains effective as your infrastructure evolves.

Use PowerDMARC's free DKIM Checker to verify your configuration, generate new DKIM records with the DKIM Record Generator, and simplify ongoing key management with Hosted DKIM if you're securing multiple domains or email services.

PowerDMARC's Free Tools

Take control of your email authentication with PowerDMARC's free DKIM tools. Instantly check your domain, generate a new key pair, or explore the full platform. Protect your emails from tampering and gain confidence in your setup. No signup required.

DKIM Record Checker

Check your domain's DKIM record instantly, validate your selector and public key, and identify any configuration issues.

Key Features:

  • Instant DNS check: confirms your DKIM record is published and resolving correctly.
  • Selector & key validation: verifies the selector resolves and the public key is valid.
  • Signing check: confirms whether outgoing emails carry a valid DKIM-Signature header.
  • Unlimited and free: run unlimited checks with no signup required.
Use DKIM Checker

DKIM Record Generator

Generate a public/private key pair and a valid DKIM record in seconds, without formatting it by hand.

Key Features:

  • 2048-bit RSA support: generates recommended key strengths by default.
  • Ready-to-publish output: produces a correctly formatted DNS TXT record.
  • Error-free formatting: eliminates the syntax mistakes that commonly cause DKIM failures.
  • Beginner-friendly: simple interface designed for quick, hassle-free setup.
Use DKIM Generator

Secure Your Email. Enforce DKIM & DMARC with Confidence.

PowerDMARC helps you move from visibility to full protection, without guesswork. From generating and rotating DKIM keys to enforcing DMARC policies and analyzing detailed reports, the platform gives you complete control over your email authentication. Even if you are managing multiple domains and providers, PowerDMARC simplifies monitoring, enforcement, reporting, and multi-domain management from one centralized dashboard.

100K+Protected Domains
G2 LeaderIn DMARC Software
4.9/5Rating on G2

The platform is built with enterprise-grade security and compliance in mind, meeting SOC 2, ISO 27001, and GDPR standards, so your data stays protected as your email security scales.

SOC 2 ISO 27001 GDPR

Customers rely on PowerDMARC not just for its depth, but for its clarity.

"PowerDMARC is a very powerful and comprehensive tool that greatly simplifies the daily work of monitoring email authentication and security features. It provides visibility and clarity that would otherwise be difficult to achieve. I can recommend PowerDMARC to anyone looking to strengthen their email security posture!"

— Yves P., System Engineer

For global teams, accessibility matters too.

"PowerDMARC solves the complexity of managing multiple email security protocols. It's not just about moving to a 'p=reject' policy; it provides a comprehensive solution by hosting DKIM and DMARC as well. What I like best about PowerDMARC is its full support for the Japanese language, which makes the platform much more accessible and easier to manage compared to other tools."

— Hiro H., CEO

So, if you're ready to stop message tampering, improve deliverability, and gain full visibility into how your domain's email is signed, PowerDMARC gives you the tools and the support to do it right.

Frequently Asked Questions

Does DKIM encrypt email?

No. DKIM doesn't encrypt email or protect its contents from being read. It verifies that the message hasn't been modified after it was signed.

Do I need DKIM if I already use SPF?

Yes. SPF and DKIM solve different problems. SPF authenticates the sending server, while DKIM authenticates the message itself. Using both provides stronger protection and improves DMARC compliance.

Can DKIM work without DMARC?

Yes. DKIM functions independently of DMARC, but DMARC is what enforces authentication policies and alignment. Deploying DKIM without DMARC provides authentication but doesn't tell receiving servers how to handle failed messages.

How often should DKIM keys be rotated?

Most organizations rotate DKIM keys every 6 to 12 months or immediately after a suspected compromise. High-security environments may rotate keys more frequently.

Can I have multiple DKIM records?

Yes. Organizations commonly publish multiple DKIM selectors for different email providers or during key rotation. Each selector references a separate public key, allowing multiple signing configurations to coexist safely.