Internet-Draft | DNS Stamps | July 2025 |
Denis | Expires 22 January 2026 | [Page] |
This document specifies DNS Stamps, a compact format that encodes the information needed to connect to DNS resolvers. DNS Stamps encode all necessary parameters including addresses, hostnames, cryptographic keys, and protocol-specific configuration into a single string using a standard URI format. The specification supports multiple secure DNS protocols including DNSCrypt, DNS-over-HTTPS (DoH), DNS-over-TLS (DoT), DNS-over-QUIC (DoQ), and Oblivious DoH.¶
This note is to be removed before publishing as an RFC.¶
Discussion of this document takes place on the Domain Name System Working Group mailing list (namedroppers@nic.ddn.mil), which is archived at nicfs.nic.ddn.mil:~/namedroppers/*.Z.¶
Source for this draft and an issue tracker can be found at https://github.com/DNSCrypt/draft-denis-dns-stamps.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 22 January 2026.¶
Copyright (c) 2025 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
The Domain Name System (DNS) has evolved significantly from its original design as specified in [RFC1035]. While traditional DNS operates over unencrypted UDP and TCP connections on port 53
, modern DNS deployments increasingly use encrypted transports to provide confidentiality and integrity. These secure protocols include DNSCrypt [I-D.draft-denis-dprive-dnscrypt], DNS-over-TLS (DoT) [RFC7858], DNS-over-HTTPS (DoH) [RFC8484], DNS-over-QUIC (DoQ) [RFC9250], and Oblivious DNS-over-HTTPS [ODOH].¶
Each secure DNS protocol requires different configuration parameters. DNSCrypt needs a provider public key and provider name in addition to server addresses. DoH requires HTTPS endpoints and paths. DoT and DoQ need TLS configuration including certificate validation parameters. This diversity in configuration requirements creates significant challenges for both users and applications attempting to configure secure DNS resolvers.¶
Current approaches to DNS configuration suffer from several limitations. Operating system interfaces typically support only IP addresses for DNS servers, providing no mechanism to specify encryption protocols or authentication parameters. Application-specific configuration files lack standardization, making it difficult to share configurations across different DNS client implementations. Manual configuration is error-prone, particularly when dealing with cryptographic parameters like public keys or certificate hashes. There is no standard way to distribute complete resolver configurations that would enable users to easily switch between different secure DNS providers.¶
DNS Stamps address these challenges by encoding all parameters required to connect to a DNS resolver into a single, compact string using a URI format. This approach enables simple sharing of resolver configurations through copy-paste, QR codes, or URLs. It provides a consistent format across different client implementations, reduces configuration errors through format validation, and supports multiple protocols through a unified specification. DNS Stamps have been implemented in numerous DNS client applications and are used by several public DNS resolver operators to publish their server configurations.¶
The remainder of this document is organized as follows. Section 2 establishes conventions and defines the encoding primitives used throughout the specification. Section 3 provides a high-level overview of the DNS Stamps format. Section 4 details the specific format for each supported protocol. Section 5 covers operational aspects including generation, parsing, and validation. Section 6 analyzes security considerations. Section 7 discusses implementation considerations. Section 8 specifies IANA registrations. The appendices provide test vectors and examples.¶
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This document uses the following terminology:¶
The following encoding primitives are used throughout this specification:¶
‖
Denotes concatenation of byte sequences.¶
|
Denotes the bitwise OR operation.¶
len(x)
A single byte (unsigned 8-bit integer) representing the length of x
in bytes, where x
is a byte sequence of maximum length 255.¶
vlen(x)
Variable length encoding. Equal to len(x)
if x
is the last element of a set. Otherwise equal to (0x80 | len(x))
, indicating more elements follow.¶
LP(x)
Length-prefixed encoding, defined as len(x) ‖ x
.¶
VLP(x1, x2, ...xn)
Variable-length-prefixed set encoding, defined as vlen(x1) ‖ x1 ‖ vlen(x2) ‖ x2 ... ‖ vlen(xn) ‖ xn
. For a single-element set, VLP(x) == LP(x)
.¶
[x]
Denotes that x
is optional and may be omitted.¶
base64url(x)
The URL-safe base64 encoding of x
as specified in Section 5 of [RFC4648], without padding characters.¶
This section provides a high-level overview of the DNS Stamps format before detailing specific protocol encodings.¶
A DNS Stamp is a URI [RFC3986] with the following format:¶
sdns://base64url(payload)¶
The stamp begins with the scheme sdns://
followed by a base64url-encoded payload. The payload is a byte sequence that encodes all parameters needed to connect to the DNS resolver.¶
The general structure of the payload is:¶
protocol_identifier ‖ protocol_specific_data¶
The payload always begins with a single-byte protocol identifier that determines how to interpret the remaining bytes. The base64url encoding is applied to the entire payload as a single operation after concatenating all components.¶
The following protocol identifiers are defined:¶
Value | Protocol | Description |
---|---|---|
0x00 | Plain DNS | Traditional unencrypted DNS |
0x01 | DNSCrypt | DNSCrypt protocol |
0x02 | DNS-over-HTTPS | DNS queries over HTTPS |
0x03 | DNS-over-TLS | DNS queries over TLS |
0x04 | DNS-over-QUIC | DNS queries over QUIC |
0x05 | Oblivious DoH Target | Target server for Oblivious DoH |
0x81 | Anonymized DNSCrypt Relay | Relay for DNSCrypt anonymization |
0x85 | Oblivious DoH Relay | Relay for Oblivious DoH |
Protocol identifiers in the range 0x80-0xFF are reserved for relay/proxy protocols that forward queries to other servers.¶
Several stamp types include a properties field, which is a 64-bit little-endian integer. Each bit in this field represents a property of the resolver:¶
Bit | Property | Description |
---|---|---|
0 | DNSSEC | The server validates DNSSEC signatures |
1 | No Logs | The server does not keep query logs |
2 | No Filter | The server does not filter or block domains |
3-63 | Reserved | Must be set to zero |
When encoding, undefined property bits MUST be set to zero. When decoding, undefined property bits MUST be ignored to allow future extensions.¶
This section specifies the exact format for each supported protocol type. Each format is presented with its structure, field descriptions, and encoding requirements.¶
Plain DNS stamps encode parameters for traditional unencrypted DNS resolvers.¶
DNSCrypt stamps encode parameters for DNSCrypt servers.¶
0x01
Protocol identifier for DNSCrypt.¶
props
Properties field (8 bytes, little-endian).¶
addr
IP address and optional port. IPv6 addresses MUST be enclosed in square brackets. Default port is 443
.¶
pk
Provider’s Ed25519 public key (exactly 32 bytes, raw binary format).¶
provider_name
DNSCrypt provider name (e.g., 2.dnscrypt-cert.example.com
).¶
DoH stamps encode parameters for DNS-over-HTTPS servers.¶
payload = 0x02 ‖ props ‖ LP(addr) ‖ VLP(hash1, ..., hashn) ‖ LP(hostname) ‖ LP(path) [ ‖ VLP(bootstrap1, ..., bootstrapn) ]¶
0x02
Protocol identifier for DNS-over-HTTPS.¶
props
Properties field (8 bytes, little-endian).¶
addr
IP address of the server. May be empty string if hostname resolution is required.¶
hashi
SHA256 digests of certificates in the validation chain (each exactly 32 bytes).¶
hostname
Server hostname with optional port. Default port is 443
.¶
path
Absolute URI path (e.g., /dns-query
).¶
bootstrapi
Optional IP addresses for resolving hostname.¶
DoT stamps encode parameters for DNS-over-TLS servers.¶
DoQ stamps encode parameters for DNS-over-QUIC servers.¶
ODoH target stamps encode parameters for Oblivious DoH target servers.¶
DNSCrypt relay stamps encode parameters for anonymization relays.¶
This section describes how to generate, parse, and validate DNS stamps in practice.¶
To generate a DNS stamp:¶
Select the appropriate protocol identifier.¶
Encode the properties field as 8 bytes in little-endian format.¶
Encode each parameter using the specified length-prefixing.¶
Concatenate all components in the specified order.¶
Apply base64url encoding to the complete payload.¶
Prepend "sdns://"
to create the final stamp.¶
Implementations generating DNS stamps MUST:¶
To parse a DNS stamp:¶
Verify the stamp begins with "sdns://"
.¶
Extract and base64url-decode the payload.¶
Read the first byte as the protocol identifier.¶
Parse remaining fields according to the protocol format.¶
Validate all fields meet requirements.¶
Implementations MUST detect and handle these error conditions:¶
Invalid base64url encoding¶
Unknown protocol identifier¶
Truncated payload¶
Invalid length prefixes¶
Malformed fields¶
Implementations SHOULD provide descriptive error messages indicating the specific validation failure.¶
Hostnames in DNS stamps MUST be represented in their Unicode form within the stamp payload. Implementations MUST NOT apply punycode encoding before storing hostnames in stamps. When using the hostname for actual DNS queries or TLS connections, implementations MUST apply the appropriate encoding for the protocol being used.¶
This approach:¶
DNS stamps contain security-critical configuration including server addresses, cryptographic keys, and certificate hashes. The integrity of stamps is essential - a modified stamp could redirect users to malicious resolvers.¶
For protocols using TLS (DoH, DoT, DoQ), stamps may include SHA256 hashes of certificates in the validation chain. These provide certificate pinning but require careful management.¶
Implementations MUST:¶
DNS stamps may reveal information about resolver configuration:¶
Server Locations: IP addresses indicate geographic regions¶
Logging Policies: Properties flags indicate data retention¶
Query Privacy: Bootstrap resolvers may see some queries¶
Users should understand the privacy implications of their chosen resolvers. Applications SHOULD display relevant properties clearly.¶
Malformed stamps could trigger implementation vulnerabilities:¶
Applications supporting multiple protocols MUST NOT automatically downgrade from secure to less secure protocols. For example:¶
Never downgrade from DoH to plain DNS¶
Never ignore certificate validation failures¶
Never bypass authentication requirements¶
If a secure connection fails, the implementation SHOULD report the error rather than attempting insecure alternatives.¶
DNS stamp support can be integrated at various levels:¶
Applications SHOULD:¶
This appendix provides complete examples of DNS stamp encoding with step-by-step explanations.¶
Configuration:¶
Step-by-step encoding:¶
Protocol identifier: 0x00
¶
Properties: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
(bit 0 set, little-endian)¶
LP(“192.0.2.53”): 0x0A ‖ “192.0.2.53” = 0x0A 0x31 0x39 0x32 0x2E 0x30 0x2E 0x32 0x2E 0x35 0x33¶
Concatenate: 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0A 0x31 0x39 0x32 0x2E 0x30 0x2E 0x32 0x2E 0x35 0x33
¶
Base64url encode: AAEAAAAAAAAACjE5Mi4wLjIuNTM
¶
Final stamp: sdns://AAEAAAAAAAAACjE5Mi4wLjIuNTM
¶
Configuration:¶
Server: 198.51.100.1
¶
Port: 5553
¶
Provider public key: e801...bf82
(32 bytes)¶
Provider name: 2.dnscrypt-cert.example.com
¶
Properties: DNSSEC, No logs, No filter (bits 0, 1, 2 set)¶
Step-by-step encoding:¶
Protocol identifier: 0x01
¶
Properties: 0x07 0x00 0x00 0x00 0x00 0x00 0x00 0x00
¶
LP(“198.51.100.1:5553”): 0x11 ‖ address¶
LP(public key): 0x20 ‖ 32 bytes of key¶
LP(“2.dnscrypt-cert.example.com”): 0x1B ‖ provider name¶
Concatenate all components¶
Base64url encode¶
Final stamp: sdns://AQcAAAAAAAAAETE5OC41MS4xMDAuMTo1NTUzIOgBsd...
¶
Configuration:¶
Hostname: dns.example.com
¶
Path: /dns-query
¶
No specific IP address¶
Certificate hash: 3b7f...b663
(32 bytes)¶
Properties: No logs (bit 1 set)¶
Step-by-step encoding:¶
Protocol identifier: 0x02
¶
Properties: 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00
¶
LP(“”): 0x00 (empty address)¶
VLP(cert hash): Since it’s the only hash, same as LP: 0x20 ‖ 32 bytes¶
LP(“dns.example.com”): 0x0F ‖ hostname¶
LP(“/dns-query”): 0x0A ‖ path¶
No bootstrap IPs¶
Concatenate, base64url encode¶
Final stamp: sdns://AgIAAAAAAAAAAAAAD2Rucy5leGFtcGxlLmNvbQovZG5zLXF1ZXJ5
¶
This appendix provides test vectors for validating DNS stamp implementations.¶
Input: Protocol: Plain DNS Address: [2001:db8::1]:53 Properties: DNSSEC Encoded stamp: sdns://AAEAAAAAAAAADlsyMDAxOmRiODo6MV0 Decoded: Protocol ID: 0x00 Properties: 0x0100000000000000 Address: "[2001:db8::1]"¶
Input: Protocol: DNS-over-HTTPS Hostname: dns.example.com Path: /dns-query Cert Hash 1: 1111111111111111111111111111111111111111111111111111111111111111 Cert Hash 2: 2222222222222222222222222222222222222222222222222222222222222222 Properties: None Encoded stamp: sdns://AgAAAAAAAAAAACCRERERERERERERERERERERERERERERERERERERERERESAiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiD2Rucy5leGFtcGxlLmNvbQovZG5zLXF1ZXJ5 Decoded: Protocol ID: 0x02 Properties: 0x0000000000000000 Address: "" Hash count: 2 Hash 1: 1111111111111111111111111111111111111111111111111111111111111111 Hash 2: 2222222222222222222222222222222222222222222222222222222222222222 Hostname: "dns.example.com" Path: "/dns-query"¶
Input: Protocol: DNS-over-TLS Hostname: dot.example.com:853 Address: 192.0.2.1 Bootstrap: 198.51.100.1, 203.0.113.1 Properties: No logs, No filter Encoded stamp: sdns://AwYAAAAAAAAACTE5Mi4wLjIuMQAPZG90LmV4YW1wbGUuY29tCwwxOTguNTEuMTAwLjELMjAzLjAuMTEzLjE Decoded: Protocol ID: 0x03 Properties: 0x0600000000000000 Address: "192.0.2.1" No certificate hashes Hostname: "dot.example.com:853" Bootstrap count: 2 Bootstrap 1: "198.51.100.1" Bootstrap 2: "203.0.113.1"¶
The author would like to thank the DNSCrypt community for their extensive feedback and implementation experience. Special recognition goes to the developers of the various DNS stamp implementations who helped refine the format through practical deployment.¶
Thanks also to the teams behind secure DNS protocols - DNSCrypt, Anonymized DNSCrypt, DoH, DoT, and DoQ - whose work made DNS stamps both necessary and useful. Their efforts to improve DNS privacy and security provided the foundation for this specification.¶