You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DNSCrypt protocol is designed to encrypt and authenticate DNS traffic between clients and resolvers. This document specifies the protocol and its implementation.
26
+
The DNSCrypt protocol is designed to encrypt and authenticate DNS traffic between clients and resolvers. This document specifies the protocol and its implementation, providing a standardized approach to securing DNS communications. DNSCrypt improves confidentiality, integrity, and resistance to attacks affecting the original DNS protocol while maintaining compatibility with existing DNS infrastructure.
32
27
33
28
--- middle
34
29
35
30
# Introduction
36
31
37
-
The document defines the DNSCrypt protocol, which encrypts and authenticates DNS {{!RFC1035}} queries and responses, improving confidentiality, integrity, and resistance to attacks affecting the original DNS protocol.
32
+
The Domain Name System (DNS) {{!RFC1035}} is a critical component of Internet infrastructure, but its original design did not include security features to protect the confidentiality and integrity of queries and responses. This document defines the DNSCrypt protocol, which encrypts and authenticates DNS queries and responses, improving confidentiality, integrity, and resistance to attacks affecting the original DNS protocol.
33
+
34
+
The protocol is designed to be lightweight, extensible, and simple to implement securely on top of an existing DNS client, server or proxy. It provides a standardized approach to securing DNS communications while maintaining compatibility with existing DNS infrastructure.
35
+
36
+
Key features of the DNSCrypt protocol include:
37
+
38
+
- Stateless operation: Every query can be processed independently from other queries, with no session identifiers required.
39
+
- Flexible key management: Clients can replace their keys whenever they want, without extra interactions with servers.
40
+
- Proxy support: DNSCrypt packets can securely be proxied without having to be decrypted, allowing client IP addresses to be hidden from resolvers ("Anonymized DNSCrypt").
41
+
- Shared infrastructure: Recursive DNS servers can accept DNSCrypt queries on the same IP address and port used for regular DNS traffic.
42
+
- Attack mitigation: DNSCrypt mitigates two common security vulnerabilities in regular DNS over UDP: amplification and fragmentation attacks.
38
43
39
-
The protocol is designed to be lightweight, extensible, and simple to implement securely on top of an existing DNS client, server or proxy.
44
+
The protocol uses modern cryptographic primitives including X25519 {{!RFC7748}} for key exchange and XChaCha20-Poly1305 {{!RFC8439}} for authenticated encryption, providing strong security guarantees while maintaining high performance.
45
+
46
+
This document specifies version 2 of the DNSCrypt protocol, which represents the current recommended version for implementation.
40
47
41
48
DNS packets do not need to be parsed or rewritten. DNSCrypt simply wraps them in a secure, encrypted container. Encrypted packets are then exchanged the same way as regular packets, using the standard DNS transport mechanisms. Queries and responses are sent over UDP, falling back to TCP for large responses only if necessary.
42
49
@@ -274,15 +281,69 @@ or
274
281
275
282
# Implementation Status
276
283
277
-
*This note is to be removed before publishing as an RFC.*
278
-
279
-
Multiple implementations of the protocol described in this document have been developed and verified for interoperability.
284
+
*Note: This section is to be removed before publishing as an RFC.*
280
285
281
-
A comprehensive list of known implementations can be found at [](https://dnscrypt.info/implementations).
286
+
Multiple implementations of the protocol described in this document have been developed and verified for interoperability. A comprehensive list of known implementations can be found at [](https://dnscrypt.info/implementations).
282
287
283
288
# Security Considerations
284
289
285
-
DNSCrypt does not protect against attacks on DNS infrastructure.
290
+
## Protocol Security
291
+
292
+
The DNSCrypt protocol provides several security benefits:
293
+
294
+
1. **Confidentiality**: DNS queries and responses are encrypted using XChaCha20-Poly1305, preventing eavesdropping of DNS traffic.
295
+
2. **Integrity**: Message authentication using Poly1305 ensures that responses cannot be tampered with in transit.
296
+
3. **Authentication**: The use of X25519 for key exchange and Ed25519 for certificate signatures provides strong authentication of resolvers.
297
+
4. **Forward Secrecy**: Short-term key pairs are used for each session, providing forward secrecy.
298
+
299
+
## Implementation Security
300
+
301
+
Implementations should consider the following security aspects:
302
+
303
+
1. **Key Management**:
304
+
- Resolvers MUST rotate their short-term key pairs at least every 24 hours
305
+
- Previous secret keys MUST be securely erased after rotation
306
+
- Provider secret keys used for certificate signing SHOULD be stored in hardware security modules (HSMs)
307
+
308
+
2. **Nonce Management**:
309
+
- Nonces MUST NOT be reused for a given shared secret
310
+
- Clients SHOULD include timestamps in their nonces to prevent replay attacks
311
+
- Resolvers SHOULD verify that nonces are within a reasonable time window
312
+
313
+
3. **Padding**:
314
+
- Implementations MUST use the specified padding scheme to prevent traffic analysis
315
+
- The minimum query length SHOULD be adjusted based on network conditions
316
+
317
+
4. **Certificate Validation**:
318
+
- Clients MUST verify certificate signatures using the provider's public key
319
+
- Certificates MUST be checked for validity periods
320
+
- Clients MUST prefer certificates with higher serial numbers
321
+
322
+
## Attack Mitigation
323
+
324
+
DNSCrypt provides protection against several types of attacks:
325
+
326
+
1. **DNS Spoofing**: The use of authenticated encryption prevents spoofed responses
327
+
2. **Amplification Attacks**: The padding requirements and minimum query length help prevent amplification attacks
328
+
3. **Fragmentation Attacks**: The protocol handles fragmentation in a way that prevents certain types of attacks
329
+
4. **Replay Attacks**: The use of nonces and timestamps helps prevent replay attacks
330
+
331
+
## Privacy Considerations
332
+
333
+
While DNSCrypt encrypts DNS traffic, there are some privacy considerations:
334
+
335
+
1. **Resolver Knowledge**: Resolvers can still see the client's IP address unless Anonymized DNSCrypt is used
336
+
2. **Query Patterns**: Even with encryption, the size and timing of queries may reveal information
337
+
3. **Certificate Requests**: Initial certificate requests are unencrypted and may reveal client capabilities
338
+
339
+
## Operational Security
340
+
341
+
Operators should consider:
342
+
343
+
1. **Key Distribution**: Provider public keys should be distributed securely to clients
344
+
2. **Certificate Management**: Certificates should be signed on dedicated hardware, not on resolvers
345
+
3. **Access Control**: Resolvers may implement access control based on client public keys
346
+
4. **Monitoring**: Operators should monitor for unusual patterns that may indicate attacks
0 commit comments