Function netdb::hosts::poll_host_by_name [] [src]

pub fn poll_host_by_name(name: &str, reactor: &Handle) -> HostByName

Returns host information for a given host name.

The name is either a hostname, an IPv4 or IPv6 address in its standard text notation. In the latter two cases, no lookups are performed and a HostEnt is returned with name as the canonical name, the parsed address as the sole address, and no aliases.

Otherwise the name is interpreted as a host name and lookups according to the system configuraition are performed.

The function returns a future that performes all necessary IO via the Tokio reactor given by reactor.

Limitations

For this initial version of the crate, the lookup is a files lookup first and only if that does fail to yield a result, a DNS query for both A and AAAA records. This initial version also does not yet fill the aliases list of the returned HostEnt.