JFLib

netio/dns/secure.rs#

Source: lib/netio/dns/secure.rs

encrypted name servers: DNS over TLS (RFC 7858) and over HTTPS (RFC 8484)
  • enum Server an encrypted name server
    • Tls { addr: SocketAddr, tls: ClientConfig } -- DNS over TLS at addr (port 853 as a rule); tls.server_name is the name its certificate must carry (a DNS name or the IP address)
    • Https { url: Url, addrs: Vec<SocketAddr>, tls: ClientConfig } -- DNS over HTTPS: POST to url; its host by dns::resolve, or at addrs when there are any (bootstrap addresses); tls.server_name the URL's host

impl Server

  • fn tls(addr: SocketAddr, name: &str) -> Server DNS over TLS to addr whose certificate names name, checked against the system's CAs; sessions resumed
  • fn https(url: &str) -> Option<Server> DNS over HTTPS to an https URL ("https://dns.example/dns-query"), the system's CAs; None when it is not one
  • fn at(self, addrs: Vec<SocketAddr>) -> Server the same server at these addresses (DNS over HTTPS without a lookup of its host)

Source: docs/API.md in the JFLib repository.