Struct trust_dns_resolver::Resolver [] [src]

pub struct Resolver { /* fields omitted */ }

The Resolver is used for performing DNS queries.

For forward (A) lookups, hostname -> IP address, see: Resolver::lookup_ip

Methods

impl Resolver
[src]

Construct a new Resolver with the given ClientConnection, see UdpClientConnection and/or TcpCLientConnection

Arguments

  • config - configuration for the resolver
  • options - resolver options for performing lookups
  • client_connection - ClientConnection for establishing the connection to the DNS server

Returns

A new Resolver

Performs a DNS lookup for the IP for the given hostname.

Based on the configuration and options passed in, this may do either a A or a AAAA lookup, returning IpV4 or IpV6 addresses. (Note: current release only queries A, IPv4)

Arguments

  • host - string hostname, if this is an invalid hostname, an error will be thrown. Currently this must be a FQDN, with a trailing ., e.g. www.example.com.. This will be fixed in a future release.