Struct dnsoverhttps::Client[][src]

pub struct Client { /* fields omitted */ }

A DoH client

It will use the configured DoH server to send all resolve queries to.

Example

let client = dnsoverhttps::Client::from_url("https://1.1.1.1/dns-query").unwrap();
let addr = client.resolve_host("example.com");

Methods

impl Client
[src]

Create a new DoH client using the given query URL. The URL's host will be resolved using the system's resolver. The host will be queried using a POST request using the application/dns-message content-type for the body.

Create a new DoH client using the given query URL and host. This should be used to bootstrap DoH resolving without the system's resolver. The URL can contain the host's IP and the hostname is used in the HTTP request. The host will be queried using a POST request using the application/dns-message content-type for the body.

Caution

This will disable hostname verification of the TLS server certificate. The certificate is still checked for validity.

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

This method queries the configured server over HTTPS for both IPv4 and IPv6 addresses.

If the host cannot be found, the list will be empty. If any errors are encountered during the resolving, the error is returned.

Trait Implementations

impl Default for Client
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for Client

impl Sync for Client