DNSCrypt

From HandWiki
Short description: Protocol to encrypt DNS queries


DNSCrypt is a network protocol that authenticates and encrypts Domain Name System (DNS) traffic between the user's computer and recursive name servers. DNSCrypt wraps unmodified DNS traffic between a client and a DNS resolver in a cryptographic construction, preventing eavesdropping and forgery by a man-in-the-middle.[1]

It also mitigates UDP-based amplification attacks by requiring a question to be at least as large as the corresponding response. Thus, DNSCrypt helps to prevent DNS amplification attacks.[2](§9)

DNSCrypt was originally designed by Frank Denis and Yecheng Fu. Multiple free and open source software implementations exist. It is available for a variety of operating systems, including Unix, Apple iOS, Linux, Android, and Microsoft Windows.[3] The free and open source software implementation dnscrypt-proxy[4] additionally integrates ODoH.[5]

Deployment

dnscrypt-proxy, a DNSCrypt client running on Linux

In addition to private deployments, the DNSCrypt protocol has been adopted by several public DNS resolvers, the vast majority being members of the OpenNIC network, as well as virtual private network (VPN) services.

OpenDNS (now a part of Cisco) announced the first public DNS service supporting DNSCrypt on 6 December 2011, shortly followed by CloudNS Australia.[6]

On 29 March 2016, Yandex announced support for the DNSCrypt protocol on their public DNS servers, as well as in Yandex Browser.[citation needed]

On 14 October 2016, AdGuard added DNSCrypt to their DNS filtering module so that users could move from their ISPs to custom or AdGuard's own DNS servers for online privacy and ad blocking.[7][8]

On 10 September 2018, the Quad9 nonprofit public recursive resolver service announced support for DNSCrypt.[9]

Other servers that support secure protocol are mentioned in the DNSCrypt creators' list.[10]

Protocol

DNSCrypt can be used either over UDP or over TCP. In both cases, its default port is 443.[2] Even though the protocol radically differs from HTTPS, both service types utilize the same port. However, even though DNS over HTTPS and DNSCrypt are possible on the same port, they must still run separately on different servers. Two server applications cannot run simultaneously on the same server if both utilize the same port for communication; though a multiplexing approach is theoretically possible.

Instead of relying on trusted certificate authorities commonly found in web browsers, the client has to explicitly trust the public signing key of the chosen provider. This public key is used to verify a set of certificates, retrieved using conventional DNS queries.[2](§1) These certificates contain short-term public keys used for key exchange, as well as an identifier of the cipher suite to use. Clients are encouraged to generate a new key for every query, while servers are encouraged to rotate short-term key pairs every 24 hours.[2](§13)

The DNSCrypt protocol can also be used for access control or accounting, by accepting only a predefined set of public keys. This can be used by commercial DNS services to identify customers without having to rely on IP addresses.[2](§13)

Queries and responses are encrypted using the same algorithm and padded to a multiple of 64 bytes in order to avoid leaking packet sizes. Over UDP, when a response would be larger than the question leading to it, a server can respond with a short packet whose TC (truncated) bit has been set. The client should then retry using TCP and increase the padding of subsequent queries.[2](§9)

Versions 1 and 2 of the protocol use the X25519 algorithm for key exchange, EdDSA for signatures, as well as XSalsa20-Poly1305 or XChaCha20-Poly1305 for authenticated encryption.[2](§11)

As of 2023, there are no known vulnerabilities in the DNSCrypt protocol nor practical attacks against its underlying cryptographic constructions.

Anonymized DNSCrypt

Anonymized DNSCrypt is a protocol extension proposed in 2019 to further improve DNS privacy.[11]

Instead of directly responding to clients, a resolver can act as a transparent proxy to another resolver, hiding the real client IP to the latter. Anonymized DNSCrypt is a lightweight alternative to Tor and SOCKS proxies, specifically designed for DNS traffic.[11]

Deployment of Anonymized DNSCrypt started in October 2019, and the protocol adoption was fast, with 40 DNS relays being set up only two weeks after the public availability of client and server implementations.[12]

See also

References

  1. Biggs, John (6 December 2011). "DNSCrypt Encrypts Your DNS Traffic Because There's Always Someone Out To Get You". https://techcrunch.com/2011/12/05/dnscrypt-encrypts-your-dns-traffic-because-theres-always-someone-out-to-get-you/. 
  2. 2.0 2.1 2.2 2.3 2.4 2.5 2.6 "DNSCrypt version 2 protocol specification (DNSCRYPT-V2-PROTOCOL.txt)" (in en). https://github.com/DNSCrypt/dnscrypt-protocol/blob/master/DNSCRYPT-V2-PROTOCOL.txt. "(UDP) The response length should always be equal to or shorter than the initial client query length." 
  3. "DNSCrypt - Implementations". https://dnscrypt.info/implementations. 
  4. "DNSCrypt/dnscrypt-proxy: dnscrypt-proxy 2 - A flexible DNS proxy, with support for encrypted DNS protocols.". DNSCrypt. https://github.com/jedisct1/dnscrypt-proxy. 
  5. "Oblivious DoH · DNSCrypt/dnscrypt-proxy Wiki" (in en). DNSCrypt project. https://github.com/DNSCrypt/dnscrypt-proxy/wiki/Oblivious-DoH. 
  6. Ulevitch, David (6 December 2011). "DNSCrypt – Critical, fundamental, and about time." (in en-US). https://umbrella.cisco.com/blog/dnscrypt-critical-fundamental-and-about-time. 
  7. "AdGuard DNS Now Supports DNSCrypt". https://blog.adguard.com/en/adguard-dns-now-supports-dnscrypt. 
  8. "DNS filtering". https://kb.adguard.com/en/general/dns-filtering-android. 
  9. "DNSCrypt Now in Testing". 30 August 2018. https://www.quad9.net/privacy-dnscrypt-testing/. 
  10. "DNSCrypt - List of public DoH and DNSCrypt servers". https://dnscrypt.info/public-servers. 
  11. 11.0 11.1 "Anonymized DNSCrypt specification". DNSCrypt. https://github.com/DNSCrypt/dnscrypt-protocol/blob/master/ANONYMIZED-DNSCRYPT.txt. 
  12. "Anonymized DNS relays". DNSCrypt. 1 November 2019. https://github.com/DNSCrypt/dnscrypt-resolvers/blob/1d35de0dc4423c4a1293c78ec0edf0728d3f7f4c/v2/relays.md. 

External links