RFC 7858: DNS over TLS

Summary

In May 2016, Zi Hu, Liang Zhu, John Heidemann, Allison Mankin, Duane Wessels and Paul Hoffman specified in RFC 7858 how DNS queries reach the resolver encrypted with TLS. DNS over TLS uses its own port 853 and keeps connections open so that not every query needs a new handshake. Stricter ways to authenticate the resolver were added by RFC 8310 in March 2018.

A dedicated port against downgrades

Classic DNS runs in plaintext on port 53. RFC 7858 specifies port 853 and forbids offering DNS over TLS on port 53. The reasoning: a client should not have to guess whether TLS is spoken, and an attacker should not be able to downgrade the connection to plaintext unnoticed.

So that encryption does not slow things down, clients should send several queries in a row without waiting for answers. Responses may arrive in a different order and are matched by their DNS ID.

Two profiles, refined later

RFC 7858 describes an opportunistic profile that encrypts without validating the certificate, and a profile with a key known in advance and pinned. The document explicitly announces further authentication methods for later.

RFC 8310 delivered them in 2018 with the Strict Privacy and Opportunistic Privacy profiles. In the strict profile, the client aborts if the resolver cannot authenticate itself.

Ideas

  • TLS protects DNS queries from eavesdropping and tampering in transit.
  • Port 853 cleanly separates DNS over TLS from plaintext DNS on port 53.
  • Open connections save repeated TCP and TLS handshakes.
  • Pipelining sends several queries without waiting.
  • Padding per RFC 7830 can hinder inferences from message sizes.

Insights

  • Transport encryption protects the path to the resolver, not against the resolver itself.
  • A dedicated port makes encryption recognisable and therefore also selectively blockable.

Facts

  • RFC 7858 appeared in May 2016 as a Proposed Standard of the DPRIVE working group.
  • Three of the six authors worked at the Information Sciences Institute of the University of Southern California.
  • RFC 7858 explicitly forbids port 53 for DNS over TLS.
  • RFC 8310 from March 2018 adds the Strict Privacy and Opportunistic Privacy profiles.

References

Remarks

  • On Linux, systemd-resolved can use both modes with DNSOverTLS=yes or opportunistic.

Recommendations

  • Prefer the strict profile with name validation for your own clients.
  • Allow or block port 853 in firewalls deliberately instead of leaving it to chance.
  • Choose resolvers by operator and logging practice, not just by speed.

Read the RFC at the RFC Editor

Search the Web Archive

Found a mistake or have something to add? Get in touch.