Christmas−30 % for 12 months with codeGet the offer →
  1. Home
  2. Glossary
  3. DKIM

Updated

Definition

DKIM: the signature that proves where your email comes from

DKIM is a cryptographic signature added to each email by the sending server and verified with a public key published in your DNS. It proves the message was signed for your domain and that its signed parts were not altered in transit.

  • Standard RFC 6376
  • 2048-bit key recommended
  • Free check
SPF, DKIM and DMARC authentication results in Passmundi reports
DKIM: passd=example.co.uk
DKIM: failinvalid signature

What is a DKIM signature?

DKIM (DomainKeys Identified Mail), defined in RFC 6376, is a cryptographic signature that the sending server adds to every message. It proves two things to the recipient: the message was signed by a server holding the domain's private key, and the signed parts, the body and the main headers, have not changed in transit. DKIM does not encrypt the message, it signs it.

How DKIM works

The sending server computes a hash of the body and of the chosen headers, signs it with the private key and adds a DKIM-Signature header. Among other things it contains d=, the signing domain, and s=, the selector. The receiving server queries DNS at selector._domainkey.domain, retrieves the public key published as TXT and verifies the signature. A domain can have several selectors, for instance one per sending service. Unlike SPF, a DKIM signature usually survives forwarding, as long as the message is not modified.

DKIM alone does not protect the visible address: the d= domain can differ from the one in the From field. DMARC is what requires them to match.

A DKIM signature and key example

The header added to the message, then the matching public key in DNS:

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=example.co.uk; s=mail2026; h=from:to:subject:date;
 bh=…; b=…

mail2026._domainkey.example.co.uk.  IN  TXT  "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0B…"

The p= value is the public key, shortened here. A 2048-bit key is longer than 255 characters and is published as several strings within the same record.

Common mistakes

  • A key that is too short: 1024 bits is the minimum, 2048 bits is the recommended length.
  • A key that never changes: plan a rotation by publishing a new selector before retiring the old one.
  • A service that does not sign with your domain: website, invoicing or newsletters go out without DKIM, or signed with the provider's domain.
  • A key pasted incorrectly into DNS: one stray space, quote or line break and verification fails.
  • A message altered on the way: a mailing list or gateway that adds a footer or rewrites the subject breaks the signature.

What Passmundi does

Passmundi verifies the DKIM signature of every incoming message, together with SPF and DMARC, and holds back a message from a known contact whose authentication fails, with the reason shown. It does not sign your messages: DKIM signing is configured with your mailbox provider (Microsoft 365, Google Workspace, your host) and stays the same with Passmundi. The free SPF, DKIM and DMARC checker tests your domain and gives it a score out of 100.

DKIM

DKIM key concepts

The vocabulary you need to configure DKIM or read a DKIM-Signature header.

Private key

Kept by the sending server, it signs every message. It should never leave that server.

Public key

Published as TXT in your DNS, it lets any recipient verify the signature.

Selector (s=)

The name that tells receivers where to find the public key: selector._domainkey followed by your domain.

Signing domain (d=)

The domain that vouches for the message. DMARC checks that it matches the visible address.

Key rotation

Changing keys limits the damage if a private key leaks. A new selector avoids any interruption.

Broken signature

Any change to the body or to a signed header after sending makes verification fail.

Setup

Set up or check DKIM in three steps

Signing is switched on in each service that sends on your behalf, and the public key is published with your DNS host.

Enable signing in every service

In the admin area of your mailbox provider, newsletter tool or invoicing software, enable DKIM for your domain, choosing a 2048-bit key if the option exists.

Publish the public key in DNS

The service gives you a selector and a value to publish as TXT, sometimes a CNAME to create instead. Paste it without stray spaces or line breaks, then confirm activation in the service.

Check a real message

Send yourself an email and read its DKIM-Signature header with the free header analyser, or test your domain with the checker. Then publish a DMARC policy.

Frequently asked questions

DKIM: your questions

Does DKIM encrypt my emails?

No. DKIM signs the message without making it unreadable: its content stays readable. The signature only proves that the message was signed for the stated domain and that the signed parts were not modified. Encryption in transit is the job of TLS.

Should I use a 1024-bit or a 2048-bit key?

2048 bits is the length recommended today, with 1024 bits as the accepted minimum. A 2048-bit key is longer than a single TXT string, so it is published as several strings within one record, which most DNS hosts handle.

Where do I find my domain's DKIM selector?

Open the headers of a message sent from your domain: the s= value in the DKIM-Signature header is the selector, and d= is the signing domain. The sending service also shows it in its admin area.

Why does a genuine message fail DKIM?

Most often, something altered the message after it was signed: a mailing list, an added footer, a rewritten subject line. Other frequent causes are a key pasted incorrectly into DNS, or a key removed while the service is still using it.

Should I change my DKIM key regularly?

Yes, it is good practice, and straight away if the private key may have been exposed. Publish the new key under a new selector, switch signing over, then remove the old key a few days later so that messages already sent can still be verified.

Does Passmundi sign my emails with DKIM?

No. Passmundi protects incoming mail: it verifies the DKIM signature of the messages you receive. Signing for your outgoing mail stays configured with your mailbox provider or host, and nothing changes there when you adopt Passmundi.

Does your domain sign its email?

The free checker tests your SPF, DKIM and DMARC in a few seconds and gives you a score out of 100.