Frequently Asked Questions
What is DNSCrypt?
DNSCrypt is a protocol that authenticates communications between a DNS client and a DNS resolver. It prevents DNS spoofing. It uses cryptographic signatures to verify that responses originate from the chosen DNS resolver and haven’t been tampered with.
It is an open specification, with free and open source reference implementations, and it is not affiliated with any company or organization.
What is DNS?
DNS is a globally distributed database that maps names to values. It is constantly used by all applications communicating over the Internet and private networks.
It typically translates names such as www.google.com
into IP addresses such as 216.58.199.36
, so that devices can determine the path to follow in order to communicate with each other.
So what is the problem?
Originally, the DNS protocol didn’t include any encryption nor authentication mechanisms; any device between a client and a DNS server could monitor and interfere with DNS traffic, without this being detected by the client.
Attackers on a local network can abuse this to conduct trivial attacks. More recently, malicious DNS servers have been massively used by malware.
The DNS security extensions (DNSSEC) were designed to partially mitigate this design flaw, by adding digital signatures to DNS responses.
What is DNSSEC
DNSSEC is a DNS Extension that allows a client to validate the DNS response on supported domains and TLDs.
Resolvers check the digital signature of DNS responses to verify that the data match what the zone owner initially configured.
Unfortunately, DNSSEC has received limited adoption, remains incompatible with some devices and software pieces, and doesn’t prevent the traffic from being monitored.
Why use DNSCrypt?
- thumb_up Encrypts and authenticates the DNS traffic
- thumb_up Specifically designed for DNS
- thumb_up Has been battle tested since 2011
- thumb_up A good amount of servers support the protocol
- thumb_up Includes mitigations against DNS amplification attacks
- thumb_up Can use UDP and TCP for transport
- thumb_up Inherently supports reordering, parallelism and priorities
- thumb_up Keeps a minimal number of states server-side
- thumb_up Very simple to implement; requires only two standard cryptographic constructions
- thumb_up Doesn’t require a TLS stack, which vastly reduces the attack surface
- thumb_up Doesn’t have any insecure parameters
- thumb_up Doesn’t rely on X509 certificates and Certificate Authorities
- thumb_up Cannot be MITM’d by standard tools
- thumb_up Enforces certificate signatures
- thumb_up Has a complete specification since 2013
- thumb_up Regular DNS and DNSCrypt can share the same port (although port 443 is recommended due to routers frequently hijacking port 53)
- thumb_up DNSCrypt and DoH can also be served simultaneously on the same port
- thumb_up Can hide client IP addresses from servers (Anonymized DNSCrypt)
- thumb_up A prototype using post-quantum cryptography is available
- thumb_down The RFC is still a work in progress
How do I get started with using DNSCrypt?
How do I get started with running my own DNSCrypt server?
Other protocols
[DNS over SSH]
- thumb_up Full encryption of the DNS protocol
- thumb_up Can be deployed on any system already running an SSH server
- thumb_up Battle-tested, widely implemented transport protocol
- thumb_up Doesn’t depend on root CAs
- thumb_up Can use DNSSEC or private CAs for public key verification
- thumb_up Supports multiple authentication mechanisms
- thumb_up Doesn’t require a TLS stack; modern implementations do not even require OpenSSL any more
- thumb_down Very tricky to configure securely
- thumb_down Requires TCP
- thumb_down Current implementations don’t scale well server-side
- thumb_down UDP queries require TCP encapsulation
- thumb_down The SFTP protocol supports reordering and parallelism, but common DNS-over-SSH tunelling cannot use this
DNS over TLS (RFC7858)
- thumb_up Full encryption of the DNS protocol
- thumb_up Has a low, but increasing number of servers in deployment
- thumb_up Partially specified as a RFC
- thumb_up Many implementations completed at various stages
- thumb_down Provides more information than regular DNS to resolver operators in order to fingerprint clients, and this has (intentionally?) never been addressed in the specification
- thumb_down Uses a dedicated port (853) likely to be blocked or monitored in situations where DNS encryption is useful
- thumb_down Initial connection is slow due to the long handshake (until TLS 1.3 is deployed, which can take time due to middleboxes)
- thumb_down Not well understood even by its proponents. It is a truck, as it is heavy and slow to load, but most if not all implementations perform a full round trip for every packet (even the excellent
miekg/dns
library as used by Tenta). - thumb_down Padding rules haven’t been specified besides a draft that doesn’t have any implementations, and a last-minute hack that requires altering DNS record sets before wrapping them
- thumb_down Requires a full TLS stack, introducing a large attack surface
- thumb_down Difficult to implement securely. Validating TLS certificates in non-browser software is the most dangerous code in the world
- thumb_down Readily compatible with industry-standard TLS interception/monitoring devices. Having people install additional root certificates is easier than custom software. Vendors are always ready to passively extract information from TLS 1.3 sessions.
- thumb_down Requires TCP
- thumb_down Requires sessions tracking on the server
- thumb_down TLS is a generic transport mechanism. It doesn’t support reordering and parallelism and doesn’t include any ways to manage priorities. New mechanisms need to be invented and implemented to do so.
- thumb_down Key management can be surprisingly hard especially if public key pinning is used by clients
- thumb_down Allows insecure algorithms and parameters
- thumb_down Will be difficult to improve without introducing more hacks. Unlikely to benefit from any improvements besides new TLS versions or homegrown reinventions.
- thumb_down Questionable practical benefits over DoH
DNS over HTTPS (DoH)
- thumb_up Full encryption of the DNS protocol
- thumb_up New implementations are being developed
- thumb_up The minimum version of HTTP used by DoH should be HTTP/2
- thumb_up Uses standard HTTP/2 or HTTP/3, on the standard port (443)
- thumb_up Will automatically benefit from improvements made to HTTP
- thumb_up Less likely to be blocked than other options
- thumb_up Can be trivially deployed on any web server, and run along existing websites; DNS response are served like simple web pages
- thumb_up Can share the same infrastructure as existing websites, and share the same certificates
- thumb_up Simple to implement over any existing web stack
- thumb_up Immediately compatible with caching proxies and CDNs
- thumb_up Allows web browsers to perform DNS queries using Javascript
- thumb_up Supports reordering, parallelism and priorities, thanks to HTTP/2
- thumb_up Can leverage existing padding mechanisms (HTTP/2 frames padding)
- thumb_up Implemented by Google DNS
- thumb_up Supported by CuRL: will soon be available in all programming languages with bindings for libcurl
- thumb_up Available in Firefox
- thumb_up Specified as a RFC
- thumb_up Can be accessed via relays (ODoH, DooH), even though this leaks more information that expected
- thumb_down Provides more information than regular DNS to resolver operators in order to fingerprint clients, but this is being addressed in the specification
- thumb_down Requires a full TLS stack and a web server
- thumb_down Interception/monitoring tools are readily available
- thumb_down Key management can be surprisingly hard especially if public key pinning is used by clients
- thumb_down Allows insecure algorithms and parameters
- thumb_down Requires TCP
- thumb_down Rarely deployed in a way that would prevent it to be trivially blocked without ECH
DNS-over-DTLS (RFC8094)
- thumb_down No known implementations
- thumb_down Many security vulnerabilities in OpenSSL due to DTLS
[DNS over QUIC] (RFC9250)
- thumb_up Full encryption of the DNS protocol
- thumb_down Uses a dedicated port: 853, can’t use port 53
- thumb_down Client devices and IP addresses can be linked
- thumb_down No clear advantage over HTTP/3
Practical considerations
All the solutions above offer the same practical security level. Compatibility with existing tools and infrastructure is what makes an actual difference.