Struct resolve::resolver::DnsResolver [] [src]

pub struct DnsResolver {
    // some fields omitted
}

Performs resolution operations

Methods

impl DnsResolver

fn new(config: DnsConfig) -> Result<DnsResolver>

Constructs a DnsResolver using the given configuration.

fn bind<A: ToSocketAddrs>(addr: A, config: DnsConfig) -> Result<DnsResolver>

Constructs a DnsResolver using the given configuration and bound to the given address.

fn resolve_addr(&self, addr: &IpAddr) -> Result<String>

Resolves an IPv4 or IPv6 address to a hostname.

fn resolve_host(&self, host: &str) -> Result<ResolveHost>

Resolves a hostname to a series of IPv4 or IPv6 addresses.

fn resolve_record<Rec: Record>(&self, name: &str) -> Result<Vec<Rec>>

Requests a type of record from the DNS server and returns the results.

fn send_message<'buf>(&self, out_msg: &Message, buf: &'buf mut [u8]) -> Result<Message<'buf>, Error>

Sends a message to the DNS server and attempts to read a response.