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
Email was built for a trusted academic network, and the protocol that carries it (SMTP) has no native way to verify who actually sent a message. Attackers have exploited that gap for decades: forging sender addresses, tampering with content in transit, and slipping fraudulent messages into real conversations. DKIM closes two of those gaps, and it is one of the highest-impact controls in any email security programme. Phishing remains the most common cyber threat facing UK businesses, according to the DCMS Cyber Security Breaches Survey 2025 — and most phishing relies on impersonating a trusted domain.
What is DKIM and how does it actually work?
DKIM uses public-key cryptography to prove a message is genuine. The domain owner generates a key pair: a private key held securely on the mail server, and a public key published in DNS. The sending server signs each message; the receiving server checks that signature against the published public key.
When a message is sent, the mail server uses the private key to sign specific components — typically the From header, the Subject, and the message body — and adds the result as a `DKIM-Signature` header. The receiving server retrieves the public key from a DNS TXT record and verifies the signature. A pass confirms two things at once: the message came from a server with access to the private key (an authorised sender), and the signed parts have not changed since signing.
That second property — tamper evidence — is what separates DKIM from SPF. SPF authorises *which servers* may send for your domain. DKIM proves the *content* arrived intact. You need both, plus a policy layer, which is where DMARC comes in.
What does DKIM sign — and what does it not protect?
DKIM signs only the message parts named in the `h=` tag of the `DKIM-Signature` header, usually the From header and the body. It does not sign every header by default, and it does not sign the SMTP envelope or delivery routing. So DKIM verifies content integrity, not the full delivery path.
This matters for your threat model. DKIM cannot stop an attacker modifying unsigned headers, adding new headers, or delivering from an unauthorised server — that last one is SPF's job. The three protocols are complementary, each covering a different failure mode:
- SPF — authorises legitimate sending sources by IP.
- DKIM — cryptographically signs the message so tampering is detectable.
- DMARC — tells receivers what to do when SPF and DKIM checks fail, and gives you reporting.
Treating any one of these as "email security done" is the most common mistake we see. They only deliver protection as a stack. The NCSC sets out the same layered approach in its email security and anti-spoofing guidance.
What are DKIM selectors and why do they matter?
A DKIM selector is a label that tells the receiving server which key to use for a given domain. Selectors let a single domain hold multiple DKIM keys — one for your primary mail server, another for a marketing platform — so you can rotate or revoke one key without disrupting the others.
The selector appears both in the `DKIM-Signature` header and in the DNS record name. A key with selector `selector1` on `amvia.co.uk` is published at `selector1._domainkey.amvia.co.uk`. Knowing your selector is essential when you audit or troubleshoot DKIM, because you cannot look up a record you cannot name.
Most businesses send from more than one platform — their tenant, a CRM, an invoicing tool, a newsletter service. Every one of those sending sources needs its own correctly published selector, or its mail fails authentication. Mapping all sending sources is the first step AMVIA takes on any email authentication build.
How do you set up DKIM in Microsoft 365?
Microsoft 365 signs all outbound mail with DKIM by default, but it uses Microsoft's own signing domain (`*.onmicrosoft.com`) — which does not align with your custom domain. To get DKIM working properly for your brand, you must enable custom-domain DKIM signing in the Microsoft Defender portal.
The process is short and well-documented:
1. In the Defender portal, go to Email & collaboration → Policies & rules → Threat policies → DKIM. 2. Select your custom domain and create the two CNAME records Microsoft provides in your DNS. 3. Enable DKIM signing for that domain once the records have propagated.
It typically takes under 30 minutes per domain, and you should enable it for *every* custom domain that sends mail through your tenant — including parked domains, which attackers love to spoof precisely because nobody checks them. Microsoft's DKIM configuration guide on Microsoft Learn walks through the exact steps. For broader hardening of the tenant around this, see AMVIA's Microsoft 365 security work and Microsoft Defender for Business.
Why does DKIM break with email forwarding?
Forwarding is DKIM's best-known limitation. When a server forwards a message, it may add a footer, rewrite headers, or alter the body — any of which invalidates the original signature. The DKIM check then fails at the final destination, even though the email is entirely legitimate.
This is exactly why DMARC evaluates *both* SPF and DKIM alignment rather than relying on one. If DKIM fails because of forwarding but SPF still passes (and aligns), DMARC can still return a pass and the message is delivered. Mailing-list software and DKIM-aware forwarding services mitigate the problem by preserving or re-signing the message.
When you read DMARC aggregate reports, forwarding is the single biggest source of "scary but harmless" DKIM failures. Knowing how to separate forwarding noise from genuine abuse is what lets you advance a DMARC policy safely instead of blocking your own invoices.
How does DKIM fit with SPF and DMARC?
DKIM delivers its full value only as part of a complete authentication stack. The correct order is: get SPF and DKIM configured and passing first, then deploy DMARC in monitoring mode (`p=none`) to observe results, identify failing legitimate sources, and only then progress to enforcement.
| Protocol | What it proves | DNS record | Without it |
|---|---|---|---|
| SPF | Which servers may send for your domain | TXT (`v=spf1 …`) | Anyone can send from your domain by IP |
| DKIM | The message is signed and unmodified | TXT (`selector._domainkey…`) | No tamper evidence on content |
| DMARC | What receivers do on failure + reporting | TXT (`_dmarc`, e.g. `v=DMARC1; p=reject`) | Failures are logged but not enforced |
Enforcement matters: a published `v=DMARC1; p=reject` policy is what actually stops spoofed mail reaching inboxes. AMVIA configures complete email authentication stacks — Microsoft 365 DKIM, SPF record management, and staged DMARC advancement — as part of a broader phishing protection and managed cybersecurity programme. If you want a deeper look at the policy layer, read our explainer on what DMARC is and how to deploy it.
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
No. DKIM confirms a message was signed by a server holding the private key, but it does not say what receivers should do when verification fails, and it does not stop someone sending from your domain without your key. It only delivers anti-spoofing protection alongside SPF (which authorises sources) and DMARC (which enforces a policy on failures).
Use a DKIM lookup tool such as MXToolbox — you will need your selector value, as you cannot query a record without its name. For Microsoft 365 the common selectors are `selector1` and `selector2`. Alternatively, send a test email to an external mailbox and inspect the full headers for a `DKIM-Signature` header and a verification result of `pass`.
Yes. Multiple DKIM keys can coexist on one domain using different selectors, and you will need them whenever several services send mail for you — your primary mail server, a marketing platform, a transactional email provider. Each service gets its own key, published as a separate DNS record under that service's designated selector name.
A DKIM failure alone does not block an email; the outcome depends on your DMARC policy. With `p=reject`, a message failing both DKIM and SPF is rejected. With `p=quarantine` it lands in spam. With `p=none` no action is taken. Without any DMARC record, most receivers simply log the failure and deliver the message anyway.
Generate a new key pair, publish the new public key in DNS under a fresh selector, switch the mail server to the new private key, allow time for DNS propagation, then remove the old public key once no in-transit mail still uses it. In Microsoft 365, rotation is handled through the DKIM settings in the Defender portal rather than manual DNS edits.
Yes — correctly configured DKIM improves it. Major providers including Gmail, Microsoft and Yahoo treat a DKIM pass as a positive signal when deciding inbox versus spam, and Google and Yahoo now require authentication for bulk senders. Combined with SPF and DMARC alignment, full authentication is one of the highest-impact steps for getting legitimate business email delivered.
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.