What Is DKIM? Email Authentication for Business Explained
DKIM (DomainKeys Identified Mail) adds a cryptographic signature to your outbound emails, proving they were sent by an authorised server and not modified in transit. It is a foundational email authentication protocol that works alongside SPF and DMARC.
Nathan Hill-Haimes
Technical Director
The problem DKIM solves
Email was designed in an era when the internet was a relatively trusted academic network. The protocol that transmits email (SMTP) has no built-in mechanism to verify that a message was actually sent by who it claims, or that it was not modified in transit. These omissions have been exploited by attackers for decades: spoofing sender addresses, modifying email content during relay, and inserting fraudulent messages into legitimate email conversations.
DKIM — DomainKeys Identified Mail — addresses two of these problems: it provides evidence that an email was authorised by the domain owner, and it detects whether the message was modified after it was signed. Together with SPF and DMARC, it forms the foundation of modern email authentication.
How DKIM works
DKIM uses public-key cryptography. The domain owner generates a key pair:
- A private key is stored securely on the mail server (or with the email service provider)
- A public key is published as a TXT record in the domain's DNS
When a message is sent, the mail server uses the private key to create a digital signature of specific message components — typically the From header, Subject, and message body. This signature is added to the email as a DKIM-Signature header.
When the receiving server processes the message, it retrieves the sender's public key from DNS and uses it to verify the signature. If the verification passes, it confirms two things: the message was sent by a server with access to the private key (an authorised sender), and the signed components of the message have not been modified since signing.
What DKIM signs and what it does not
DKIM signs specific parts of the message defined in the h= tag of the DKIM-Signature header. Typically this includes the From header and the message body. It does not, by default, sign all headers or the delivery routing information (the SMTP envelope).
This means DKIM does not prevent all forms of email manipulation — for example, it cannot stop an attacker modifying unsigned headers or adding new headers. It also does not prevent an email being delivered from an unauthorised server (that is SPF's role). The three protocols work together, each addressing different aspects of email integrity and authenticity.
DKIM selectors
A DKIM selector is a label that identifies which DKIM key to use for a given domain. This allows a domain to have multiple DKIM keys — for example, one for the primary mail server and one for a marketing email platform — and to rotate or revoke individual keys without affecting others.
The selector is included in the DKIM-Signature header and in the DNS record name. For example, a key with selector selector1 on domain amvia.co.uk would be published at selector1._domainkey.amvia.co.uk.
DKIM in Microsoft 365
Microsoft 365 signs all outbound email with DKIM by default, using Microsoft's own signing domain (e.g., *.onmicrosoft.com). For proper DKIM authentication that aligns with your custom domain, you need to enable custom domain DKIM signing in the Microsoft 365 admin centre (Defender portal → Email & collaboration → Policies → DKIM).
Enabling custom domain DKIM in Microsoft 365 involves creating two CNAME records in your domain's DNS that point to Microsoft's key infrastructure, then enabling DKIM in the admin portal. The process typically takes less than 30 minutes and is straightforward to follow with Microsoft's documentation. DKIM signing should be enabled for every custom domain that sends email through Microsoft 365.
DKIM and email forwarding
A common DKIM consideration is email forwarding. When an email is forwarded by a mail server, the forwarding server may modify the message (adding a footer, changing headers), which breaks the DKIM signature. This is a known limitation and is why DMARC uses both SPF and DKIM alignment checks — if DKIM fails due to forwarding but SPF passes, DMARC can still pass.
Mailing list software and some email forwarding services are designed to be DKIM-aware and either preserve the original signature or re-sign the forwarded message. This is an important consideration when diagnosing DMARC authentication failures in DMARC aggregate reports.
Implementing DKIM alongside SPF and DMARC
DKIM is most valuable as part of a complete email authentication implementation. The correct order is: configure SPF and DKIM correctly first, then deploy DMARC in monitoring mode to review authentication results, identify any failing legitimate sources, and advance to a DMARC enforcement policy. AMVIA configures complete email authentication stacks for UK businesses, including Microsoft 365 DKIM setup, SPF record management and DMARC policy advancement.
Is DKIM Enabled on Your Business Domain?
Many businesses running Microsoft 365 do not have custom domain DKIM configured correctly. AMVIA can check your email authentication setup and fix any gaps.
Frequently Asked Questions
DKIM alone is not sufficient. It confirms that the message was signed by a server with access to the private key, but it does not specify what to do when verification fails, and it does not prevent someone sending email from your domain without using your signing key. DKIM works with SPF and DMARC — SPF authorises sending sources, DKIM signs messages, and DMARC enforces a policy on failures.
You can check DKIM configuration using a tool such as MXToolbox's DKIM lookup — you will need to know the selector value used by your mail server. For Microsoft 365, common selectors are selector1 and selector2. You can also send a test email and examine the full headers to see whether a DKIM-Signature header is present and whether the verification result shows 'pass'.
Yes. Multiple DKIM keys can coexist for the same domain using different selectors. This is necessary when you use multiple services to send email — your primary mail server, a marketing platform, a transactional email service — each needs its own DKIM key. Each is published as a separate DNS record using the service's designated selector name.
A DKIM failure alone does not cause an email to be blocked. Its effect depends on the DMARC policy in place. With DMARC set to p=reject, a message that fails both DKIM and SPF will be rejected. With p=quarantine, it goes to spam. With p=none (monitoring only), no action is taken. Without DMARC, DKIM failures are typically logged but not acted on by most receiving servers.
DKIM key rotation involves: generating a new key pair, publishing the new public key in DNS under a new selector, configuring the mail server to use the new private key, allowing time for DNS propagation, and then removing the old public key from DNS (after confirming no messages signed with the old key are still in transit). In Microsoft 365, key rotation can be performed through the DKIM settings in the Defender portal.
Correctly configured DKIM improves deliverability. Major receiving mail providers — Gmail, Microsoft, Yahoo — use DKIM pass results as a positive signal when assessing whether to deliver email to the inbox or route it to spam. Combined with SPF and DMARC alignment, a full email authentication setup is one of the most impactful steps for improving deliverability of legitimate business email.
Related Reading
What Is DMARC?
How DMARC uses DKIM and SPF results to enforce email authentication policy for your domain.
Email Spoofing: How to Detect and Prevent It
How DKIM works alongside SPF and DMARC to prevent your domain being spoofed.
Email Security Fundamentals
The four pillars of email security and how DKIM fits into the complete picture.