Skip to content
dnscheck.app

Glossary

DKIM (DomainKeys Identified Mail): Definition and Record

What DKIM is

DKIM (DomainKeys Identified Mail) attaches a domain name to an email message by using a cryptographic signature. The sending server signs a hash of the headers and content. The receiving server (the verifier) fetches the verification key from a DNS TXT record.

A valid signature validates a signing domain and nothing more. A separate process must attach reputation to that domain.

How the signature and the DNS key work together

The signature and the data needed to fetch the key travel in the DKIM-Signature header. The verifier builds a DNS name from the d= domain and the s= selector, which is a label that picks the key. The name has the form selector._domainkey.domain.

DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed;
 d=example.com; s=brisbane; h=from:to:subject:date;
 bh=c2FtcGxlLWJvZHktaGFzaC1wbGFjZWhvbGRlcg==;
 b=c2FtcGxlLXNpZ25hdHVyZS1wbGFj
 ZWhvbGRlcg==

The bh= and b= values are sample text.

  • v=1: the version. It is required.
  • a=: the signing algorithm, here Ed25519 with SHA-256.
  • c=: how the message is normalized before hashing. It is optional and defaults to simple/simple.
  • d= and s=: the signing domain and the selector.
  • h=: the signed header fields.
  • bh=: the hash of the body. It is required.
  • b=: the signature. Whitespace inside it is ignored.

The matching key record:

brisbane._domainkey.example.com. IN TXT "v=DKIM1; k=ed25519; p=ExamplePlaceholderKeyValueNotARealKey01234A="

The p= value is placeholder text. k=ed25519 marks the key type. An Ed25519 key is 44 octets of base64 text, so the record generally fits in a single 255-byte TXT string.

An RSA record has the same shape with a longer p= value. DNS software that handles only a single 256-octet string in a TXT record limits key size, because RSA keys much longer than 1024 bits do not fit. Short Ed25519 keys fit more easily. Signers MUST use RSA keys of at least 1024 bits and SHOULD use at least 2048. Verifiers MUST NOT treat signatures from RSA keys under 1024 bits as valid. A selector has one key record, so a second key or algorithm needs its own selector.

dig +short TXT brisbane._domainkey.example.com
"v=DKIM1; k=ed25519; p=ExamplePlaceholderKeyValueNotARealKey01234A="

On Windows, use Resolve-DnsName -Type TXT brisbane._domainkey.example.com.

How to check DKIM and why it fails

Check your DKIM record by entering the domain and the selector. To see the raw record, look up the selector's TXT record. Setup steps differ by provider, so follow your provider's own DKIM documentation, then confirm the result with the checker.

Common reasons a signature fails:

  • h= does not include the From header. The verifier MUST ignore the signature.
  • The RSA key is under 1024 bits, which counts as a permanent failure.
  • The message was re-posted, for example by a mailing list. The signature typically does not survive.
  • Some intermediate handling agents break the signature, though simple relaying does not.
  • No key exists at the selector name.

Receivers may apply their own policies, such as key length, so one receiver may judge a signature differently from another. The checker shows whether a valid key can be found. It cannot show what a receiving server does with a failed signature. Verification normally happens at the inbound SMTP server or the final delivery agent, and other servers on the path may also verify.

References