In the traditional internet, DNS queries are transmitted in clear text. This means that the websites users visit, the services they use, and even their online activity can be intercepted and analyzed by Internet Service Providers (ISPs), hackers, or third-party surveillance agencies. To address this security flaw, two encryption protocols, DoH (DNS over HTTPS) and DoT (DNS over TLS), were developed. While both aim to encrypt and immutably process DNS communications, protecting user privacy, they differ significantly in their implementation, performance, compatibility, and application scenarios.
If traditional DNS is like a postcard, DoH and DoT are like enveloping a letter before sending it. While the postcard's contents are visible to anyone during transit, encrypted DNS hides them, allowing only the recipient to read them. The core concept is to protect users' internet requests from snooping and tampering during transmission.
From a technical perspective, DoT encrypts DNS queries using TLS (Transport Layer Security). TLS is the common security foundation for protocols like HTTPS and IMAPS. It establishes an encrypted channel between the TCP and application layers. In other words, DoT still uses the traditional DNS protocol structure, but the transmitted content is protected by TLS. This preserves the standard DNS interface while ensuring confidentiality. DoT typically uses port 853, creating an encrypted channel separate from normal network traffic. DoH takes a different approach. It embeds DNS queries into the standard HTTPS protocol, sending requests over port 443. Because HTTPS itself is based on TLS encryption, DoH effectively encapsulates DNS within web page requests. The key advantage of this approach is that to external networks, DoH traffic appears indistinguishable from regular web page access and cannot be easily identified or blocked. This makes DoH particularly effective in terms of privacy protection and anti-interference capabilities.
From a privacy perspective, DoH's advantage lies in its ability to effectively hide DNS requests. It is difficult for carriers or intermediaries to determine which traffic is a DNS query and which is a web page access based solely on port or protocol characteristics. For users looking to circumvent network surveillance, increase anonymity, or prevent DNS hijacking, DoH is a more ideal option. Major browsers like Firefox and Chrome already have built-in DoH functionality. Once enabled, all domain name resolutions in the browser are sent to a designated DoH server via HTTPS, achieving end-to-end encryption. DoT, on the other hand, is more popular with network administrators and system-level services. This is because DoT is more "pure" at the protocol level, solely responsible for DNS encryption and not intermingled with other network traffic. For enterprise networks or home routers, DoT's dedicated port makes it easier to manage and monitor traffic. For example, some firewalls or security gateways can directly identify DoT traffic on port 853 and selectively allow, log, or restrict DNS requests. This is precisely why DoH and DoT have distinct deployment scenarios. DoH is more commonly used at the endpoint level (such as browsers and mobile apps), emphasizing user privacy and circumvention. DoT, on the other hand, is more common at the system level (such as operating systems and network devices), emphasizing security compliance and controllability.
From a performance perspective, there are also subtle differences between the two. Because DoH is transmitted over HTTPS, it has multiple layers of encapsulation and a more complex protocol stack, which theoretically introduces a slight latency overhead. However, in modern network environments, this latency is almost negligible. Furthermore, with support for HTTP/2 and HTTP/3 (based on the QUIC protocol), DoH offers enhanced connection multiplexing and multi-channel transmission capabilities, resulting in better performance in high-concurrency scenarios. DoT's connection process is relatively straightforward, performing DNS queries immediately after establishing the TLS handshake. Its more lightweight protocol structure makes it potentially slightly faster in traditional TCP networks. Overall, the performance difference between the two in real-world use is minimal, with the real difference primarily depending on the DNS resolver's response speed and geographic location.
However, privacy and controllability often conflict. For individual users, DoH's encapsulation makes their online behavior more difficult to track, a victory for privacy protection. However, for enterprise or school network administrators, DoH poses security risks. Because all DNS requests are tunneled through HTTPS, traditional methods such as DNS log analysis, blacklist filtering, and content censorship are ineffective. This means network administrators struggle to control which domains endpoints access, and they're unable to prevent access to malicious sites. Therefore, some organizations choose to block DoH traffic at the network level, instead using DoT or enterprise-level encrypted DNS gateways. DoT offers a more balanced approach in this regard. While it also encrypts DNS, its use of a dedicated port allows administrators to manage policies and even deploy their own encrypted DNS servers within the enterprise, ensuring both security and control. This is why DoT is more widely used within organizational networks.
From a security perspective, DoH and DoT both use the same encryption foundation—TLS (Transport Layer Security). Their security strength is nearly identical, both preventing DNS requests from being eavesdropped or tampered with. The difference lies in the complexity of the encapsulation layer. DoH is "application-layer encryption," transmitted over HTTP, offering greater flexibility and compatibility. DoT is "transport-layer encryption," with a more stable architecture and standardized deployment. In other words, DoH is more like "the internet-friendly evolution of DNS," while DoT is more like "an encryption upgrade for DNS."
Looking ahead, encrypted DNS will gradually become the standard for internet communications. Whether using DoH or DoT, their core goal is to eliminate DNS as a weak link in online privacy. With the widespread adoption of new technologies like HTTP/3, QUIC, and Ech, DNS encryption will become even more transparent and ubiquitous. Perhaps in the near future, users will no longer need to worry about which protocol they're using, as all DNS queries will be encrypted, secure, and untraceable by default.
FAQ
Q1: Which is more secure, DoH or DoT?
A1: Both offer nearly identical security strengths, both based on TLS encryption to prevent DNS requests from being intercepted or tampered with. The real difference lies in the application-layer implementation and usage scenarios, not encryption strength.
Q2: Should I choose DoH or DoT?
A2: If you prioritize privacy and frequently browse the web through a browser, we recommend enabling DoH. If you're a system administrator or want global DNS encryption, we recommend using DoT.
Q3: Will DoH affect internet speed?
A3: In theory, DoH's HTTPS encapsulation will slightly increase latency, but with modern networks and optimized HTTP/2 and HTTP/3, this will be almost imperceptible. Most users will even experience faster resolution.
Q4: Can enabling DoH completely prevent tracking?
A4: No. DoH only encrypts DNS queries and cannot hide your IP address or browsing history. For more comprehensive anonymity, you should combine it with technologies like Tor.
Q5: Should enterprises ban DoH?
A5: It depends. If you need to centrally manage network access and monitor security risks, you can use DoT and disable DoH to maintain control and auditability.
Q6: Can both protocols be enabled simultaneously?
A6: Technically, it is possible, but generally, systems or applications will prioritize one protocol over the other. Mixing them does not improve security and may increase debugging complexity.
Q7: Does DoH bypass local DNS?
A7: Yes. A DoH-enabled browser will directly request the DoH server without going through local DNS resolution, potentially bypassing local network rules.