Crate dnsoverhttps [] [src]

dnsoverhttps - D'oh!

Resolve hostnames by sending DNS queries over HTTPS. It uses https://1.1.1.1 as the DNS resolver by default, hosted by Cloudflare. According to Cloudflare it is a privacy-first consumer DNS service. See https://1.1.1.1 for more information.

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

Drawbacks

Example: Default resolver

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

Example: Custom resolver

let client = dnsoverhttps::Client::from_url_with_hostname("https://172.217.21.110/experimental", "dns.google.com".to_string()).unwrap();
let addr = client.resolve_host("example.com");

Structs

Client

A DoH client

Functions

resolve_host

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