13

What is DNS over TLS (DoT), DNS over Quic (DoQ) and DNS over HTTPS (DoH & DoH3)?

DNS is an old protocol lacking all forms of security. Yet, it is one of the most fundamental protocols of the Internet. DoT and DoH are improvements to add transport security to the DNS protocol by reusing the same security layers used by HTTPS: TLS. Both DoT and DoH use TLS. DoH adds HTTP/2 between DNS and TLS for the framing. DoT also has a framing layer inherited from DNS over TCP, but it is ridiculously simple compared to HTTP/2. They both run on top of TCP.

More recently, Quic was added to the mix. Quic is an odd beast that takes TCP, TLS and the stream capability of HTTP/2 and merge them into a natively encrypted protocol implemented on top of UDP. From this new transport protocol, we get two new variants: DoQ which is similar to DoT but is using the stream capability of Quic instead of the DNS over TCP framing, and DoH3 which is DNS over HTTPS/3, HTTP/3 being HTTP over Quic.

All those protocols offer similar advantages but they have some key differences:

  • DoT and DoQ use a custom ports (tcp/853 and udp/8853 respectively) which can be easily blocked by firewalls while DoH uses the same port and protocol as used for all HTTPS web traffic (tcp/443), making it harder to block or even detect. DoH3 uses udp/443, so it is easier to block but still indistinguishable from other web traffic using this protocol, and HTTP/3 capable clients have the capability to fallback to HTTP/2 when this happens.
  • The HTTP/2 protocol used by DoH is significantly more complex than the basic framing employed by DoT. The advantage of DoH is that most HTTP/2 implementations are battle tested and offer good performance, while most DoT implementations get the DoT “spec” wrong, leading to poorer performance. When properly implemented, DoT offers lower complexity, which may theoretically have a small positive impact on battery usage, but it might be a drop in the bucket compared to TLS. The difference in latency should be non-perceivable though. 
    DoQ and DoH3 on the other side both use the same framing provided by the Quic protocol, which is greatly inspired by the HTTP/2 protocol. The different in complexity between DoQ and DoH3 is thus even thiner than between DoT and DoH.
  • As DoH uses HTTP, when implemented into a browser, there is the concern of having the same tracking capabilities as used on the web (user-agent, cookies etc.). To date, all popular clients, browsers included, are not sending any fingerprintable headers, run with no cookie jar and don't even send a user-agent.
  • DoQ and DoH3 are more resilient to packet loss. DoT and DoH are running on top of a single TCP connection, meaning that in case of a packet loss, all DNS queries or responses after this packet have to wait for the lost packet to be retransmitted (this is called head of line blocking). Thanks to Quic stream design, a single Quic session can carry multiple individual streams. Each stream is independent, and a loss of a packet only affects the stream it is associated with. With both DoQ and DoH3, each DNS query/response is isolated in its own stream, eliminating the head of line blocking issue described above. Those protocol are thus particularly well suited for mobile or highly congested networks, but won't make any substantial difference on a healthy network. One drawback is that Quic is all implemented in userland, and thus requires more CPU and battery to run than TCP. This can be an issue for bandwidth intensive applications, but DNS being pretty light, the difference should be negligible with most implementations.

Some experts like Paul Vixie recommend DoT over DoH. We don’t share this position and generally recommend DoH as it has less chances of being blocked and implementations are often better and clients supporting HTTP/3 can automatically benefit from it or fallback in case of issue thanks to the Alt-Svc/HTTPSSVC protocol negotiation.

NextDNS supports all 4 protocols. See the setup tab for more information on how to use them.

80 replies

null
    • Lady_Arwen
    • 3 yrs ago
    • Reported - view

    Olivier Poitrey is the DOH3 and DOQ available now in the Set Up tab as per above? I can’t seem to find them. How can I use them in iOS/iPadOs/macOS?

      • olivier
      • 3 yrs ago
      • Reported - view

      Lady Arwen DoH3 upgrade is automatic when supported. As of today, current versions of iOS/iPadOS and macOS do not support DoH3 yet, but we are working with Apple to make this work in future builds.

      • Lady_Arwen
      • 3 yrs ago
      • Reported - view

      Olivier Poitrey Thank you! How about DOQ? I don’t think it will be supported by iOS natively anytime soon. Is DOQ via the NextDNS App?

      thanks alot! ✌🏻✌🏻 xx

      • olivier
      • 3 yrs ago
      • Reported - view

      Lady Arwen it is unlikely that DoQ will be supported by Apple. The industry is heavily leaning in the direction of DoH with Android being the only vendor to have favord DoT. Next version of Windows 10 will support DoH natively and probably DoH3 soon after. I wouldn’t bet on DoQ being widely implemented / deployed any time soon. It does not provide any substantial benefits over DoH3.

      • Michael_Villalobos
      • 1 yr ago
      • Reported - view

      Olivier Poitrey any update yet? The best we can get is SOME DoH3 on iOS and Mac but it’s only on browsers and for iOS it’s a temporary thing until it falls back to DoH because of the stupid lock screen.

    • Just a human
    • RouterCFW
    • 3 yrs ago
    • Reported - view

    I’m happy with dns over https because I’m worried about it being detected by my isp if I use any other method. dns over https is the most disguised one

    • Just a human
    • RouterCFW
    • 3 yrs ago
    • Reported - view
    DoH3 uses udp/443, so it is easier to block

     Why doesn’t it use tcp ?

      • olivier
      • 3 yrs ago
      • Reported - view

      RouterCFW HTTP/3 uses Quic as transport. Quic is over UDP. More and more services are adding HTTP/3 support, so over time it will be as indistinguishable as tcp/443.

      • Carrot_eggs
      • 3 yrs ago
      • Reported - view

      Olivier Poitrey No, it can still be recognized. At present, mainland China has blocked many overseas suppliers that provide DOH and DOT, such as opendns, nextdns, Cloudflare DNS, AdGuard DNS, Quad9 DNS and so on.
      At present, the resolved domain names of these encrypted dns can be blocked through SNI. For example, if the third-level domain name contains keywords such as DNS and DOH, it will be blocked as follows:
      "Dns.example.com", "doh.example.com".
      I tested it on my own server and it has been verified.
      Whether it is DOH or DOT, it is currently impossible to achieve full-process encryption. If you add a new protocol, such as DoQ, it will be easier to identify, and the feature is too obvious, so the port number will be blocked directly.
      I also think DoH should be the main development direction. It would be better if SNI encryption can be completed without being recognized. SNI encryption China can also block, it is too powerful.

      https://gfw.report/blog/gfw_esni_blocking/en/

      • Jason_Hawkins
      • 3 yrs ago
      • Reported - view

      Olivier Poitrey According to the IETF doc "Servers MAY serve HTTP/3 on any UDP port". Hoping you guys run this on UDP 443 to be able to really blend in with QUIC. Thanks!

      • olivier
      • 3 yrs ago
      • Reported - view

      Jason Hawkins we run HTTP/3 on port UDP/443 already.

    • Leo
    • 3 yrs ago
    • Reported - view

    as a novice user, I would like to know if dns over quic has any settings or is it already set in the server network? and whether it has been implemented in Private DNS on Android (DNS over TLS)?

      • olivier
      • 3 yrs ago
      • Reported - view

      Leo it’s available on the server but Android does not support it yet.

      • Leo
      • 3 yrs ago
      • Reported - view

      Olivier PoitreyOh, I see. How to use dns over quic in NextDNS Cli on Windows? Are there no settings to set it?

      • olivier
      • 3 yrs ago
      • Reported - view

      Leo HTTP/3 will be added to our windows client soon.

      • Leo
      • 3 yrs ago
      • Reported - view

      Olivier Poitrey Okay. If I can  Okay. If I may know, dns over quic now only occurs on what platform and how do I activate it?

      • olivier
      • 3 yrs ago
      • Reported - view

      Leo there is no platform supporting DoQ, and it's not clear if it will be one in the future. If anything, Android would most likely be the one. HTTP/3 on the other hand is already supported by Chrome DoH, Firefox DoH and should be included in a next rev os iOS/macOS. DoH support in Windows might follow.

      • Jason_Hawkins
      • 3 yrs ago
      • Reported - view

      Olivier Poitrey Will HTTP/3 be added to the Linux cli's as well? Looking forward to benchmarking a couple of my pi's running the cli clients. 

      • olivier
      • 3 yrs ago
      • Reported - view

      Jason Hawkins it’s already there in the master. Will be released with the next revision.

      • Pro Subscriber ✅
      • Jorgen_A
      • 3 yrs ago
      • Reported - view

      Olivier Poitrey So DoQ is live now in the CLI v1.32.0? 😄 How do we know if it's using it or not?! Should "Protocol:" when running test.nextdns.io say "DOQ" or something similar?! For me it's still "DOH".

      • olivier
      • 3 yrs ago
      • Reported - view

      Jörgen A it’s DoH3 (DoH over Quic if you prefer). The CLI need the HTTP layer to transport LAN host info when report-client-info is enabled.

      • Pro Subscriber ✅
      • Jorgen_A
      • 3 yrs ago
      • Reported - view

      Olivier Poitrey Got it... 🙂 So DoH3 will not work for me, since I want  to identify my devices. Maybe will disable report-client-info a while,  just to test it out 😉

      • olivier
      • 3 yrs ago
      • Reported - view

      Jörgen A DoH3 will work for you, DoQ wont. I know it's confusing but DoQ is to DoT what DoH3 is to DoH. Both DoQ and DoH3 are on top of Quic.

      • Pro Subscriber ✅
      • Jorgen_A
      • 3 yrs ago
      • Reported - view

      Olivier Poitrey Yeah, it is kinda confusing with all protocols/layers 😉 I still only see "DOH" when using the CLI v1.32.0, but should it say "DoH3" under Protocols when using test.nextdns.io?

      • olivier
      • 3 yrs ago
      • Reported - view

      Jörgen A so CLI support DoH3 and our servers to, but only when specifically using the doh3.dns.nextdns.io so the CLI does not automatically discover it. We are not ready to enable DoH3 by default, because there are still some problem with some DoH3 capable browsers. We might release another version of CLI with an option to force the http3 hostname.