Function netdb::hosts::get_host_by_addr [] [src]

pub fn get_host_by_addr(addr: IpAddr) -> Result<Option<HostEnt>, Error>

Returns host information for a given IP address.

The IP address can either be an IPv4 or IPv6 address. The function waits for all necessary IO to resolve. Upon success, it returns a HostEnt value if a host for the given name was found or Ok(None) otherwise.


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 PTR records. This initial version also does not yet fill the aliases list of the returned HostEnt.