Crate dnsoverhttps [] [src]

dnsoverhttps - D'oh!

Resolve hostnames by sending DNS queries over HTTPS. It uses dns.google.com to send the base64-encoded DNS query over HTTPS.

Based on https://tools.ietf.org/html/draft-ietf-doh-dns-over-https-02.

(A newer version of the draft is available, but the used server supports only version 2 for now)

Drawbacks

  • TLS Certificate is not checked. The connection is done using a static IPv4 address for the server. TLS Certificate validation had to be disabled, as there's currently no way to pass the right hostname into the request library.
  • Uses a fixed IP for the dns.google.com server. This is not configurable at the moment.

Example

let addr = dnsoverhttps::resolve_host("example.com");

Functions

resolve_host

Resolve the host specified by host as a number of IpAddr.