Visual RFC.
ALL RFCs / RFC 6376
Read the RFC ↗
RFC 6376 / MECHANISM GUIDE

DNS key verification

04

The receiver resolves the selector under the signing domain and verifies the signature.

RFC 6376 · § 6.1EXAMPLE

FOLLOW THE SIGNED DATA · FICTIONAL MESSAGES AND DNS

What must the receiving server check before DKIM passes?

DKIM LAB04 / 04
Step 4 of 4 — Report verification separately from trust

Both checks must succeed. Missing/revoked keys, a different key, and temporary DNS failure are different paths.

Receiving server

d=example.org; s=mailConstructs mail._domainkey.example.org
TXT query DNS response

DNS

v=DKIM1; k=rsa; p=MIIBCgKCAQEAy5XL15qo9i3R…Matching public key
↓ Receiver performs two separate checks ↓

1 · Body hash

Hello,·team.↵
Meet·at·10.↵
Signed bh=mtWvvw/KmkZ8V67tU75C7b7ZB/JLAYAwFzjpOVEOdsU=New hash=mtWvvw/KmkZ8V67tU75C7b7ZB/JLAYAwFzjpOVEOdsU=✓ Body hash matches

2 · Header signature

b=b4KIjwYPXR91Ds2E53MQnBKs…Selected headers + original DKIM-Signature, with b= empty✓ Header-signature input matches

The signed bh= stays inside the header-signature input. Changing only the body can fail its hash while the header signature still verifies.

PASSThe body hash and signature both verify for the signing domain.
Try an alternative outcome

Changing an input shows the completed outcome. Restart restores this chapter’s original example.

Static view: prevalidated RSA/SHA-256 fixture.

Inspect the actual public fixture bytes

Real RSA-2048/SHA-256 test signatures. Names, DNS answers and messages are fictional. Private keys are never included in these public assets. Long values below are shown in full.

DKIM-Signature

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.org; s=mail; h=from:subject; bh=mtWvvw/KmkZ8V67tU75C7b7ZB/JLAYAwFzjpOVEOdsU=; b=b4KIjwYPXR91Ds2E53MQnBKsht2g21BdDvcP42Wsg+hHIpx+ikEr/hrDsIL+VBljbwHbF+uP3n/nfZNGZLb4h+JV1tPcvO6pxpXrf+x3w7UiTY4E3gbvzRhXpsTda8AeeXsAJMD/xUrPKRluvwJRmnW7v8tskn6rqADZwdBCHwvfPjBoJQkuh5kdj3/DZtMTnD0AnV5o1dVyyxBKRG/oq+VlIL+7jIZEbQ7gFfVnyOh/86LsLF2M00BqKLhnkQWeyBIjLJXXwdaa6d1YpP+Kg9zmlE0AZMIfwPuxjitZsK3pJB71Qm6TE2MpWx08P4sJadmKBHSUb3xdXKquxDbpKA==

DNS public-key value p=

MIIBCgKCAQEAy5XL15qo9i3RKdEPV5B4dPlNClTlWs9D5X1yW9m0Sdz8fhPuZYrC5R7X3D3WxsWY47v3p+mBwan/GSQzDF6y5T1wjygkZXPeposIf72M6kWgmRO4Shaz+Moq1hOEKPU29+CLkD+lznEhQsD8jBiHLM6wMSZQpc0BorecKtwDbdXDAY1WOvwmyq+wdskzZxadr0uLKUrGY/5ePyRhmbVJQdjKstATsJHrMvwXPhvATUpkIAnsYu1KNLkbXIwGjU04+ZXG/X8rREQCvIAIFWY27vLvuixn8rrF/tuTVoYNMy+tVgmBAvTTLi+IZaIfnOgtVUtZnzPQCx3B0LQMb4Be8wIDAQAB

Header signing input (b= empty, no terminal CRLF on DKIM-Signature)

from:Offers·<offers@brand.example>↵
subject:Meeting·notes↵
dkim-signature:v=1;·a=rsa-sha256;·c=relaxed/relaxed;·d=example.org;·s=mail;·h=from:subject;·bh=mtWvvw/KmkZ8V67tU75C7b7ZB/JLAYAwFzjpOVEOdsU=;·b=

A DKIM pass requires both the body-hash check and the signature check. It does not guarantee delivery or safe content.

Bounded ASCII/CRLF teaching examples. These are not a complete mail parser, DKIM implementation or DNS lookup service. Shortened hash/key/signature labels expand to actual values in the fixture details.

3 / 3
03
Check and report

Recompute the canonical body hash and verify the signature. A pass establishes signed-input integrity, not delivery safety.

DNS key verificationThe receiver resolves the selector under the signing domain and verifies the signature.DNS key verificationVerifierDNSTXT mail._domainkey.example.orgpublic verification keyLocal body hash + signature checkIntegrity for the signing domain’s selected inputs

Key idea: Query mail._domainkey.example.org for the illustrated selector.

Terms

Look up a term in the glossary ↗

Rules & examples
  • Query mail._domainkey.example.org for the illustrated selector.
  • Verify the body hash and signature with the published key.
  • Missing keys, altered signed content, or invalid algorithms prevent an ordinary valid signature result.

Examples are illustrative. Consult the linked RFC and its errata for implementation details.

Sources
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

The envelope and the letter do different jobs.

Mail transport moves a message between servers. The message format describes its contents. Authentication adds checks; it does not make every message safe.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

All chapters in RFC 6376

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗