diff options
Diffstat (limited to 'src/libstd/net/mod.rs')
| -rw-r--r-- | src/libstd/net/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libstd/net/mod.rs b/src/libstd/net/mod.rs index 7f51b1cba3f..68f3098d993 100644 --- a/src/libstd/net/mod.rs +++ b/src/libstd/net/mod.rs @@ -111,3 +111,13 @@ impl Iterator for LookupHost { pub fn lookup_host(host: &str) -> io::Result<LookupHost> { net_imp::lookup_host(host).map(LookupHost) } + +/// Resolve the given address to a hostname. +/// +/// This function may perform a DNS query to resolve `addr` and may also inspect +/// system configuration to resolve the specified address. If the address +/// cannot be resolved, it is returned in string format. +#[unstable(feature = "lookup_addr", reason = "recent addition")] +pub fn lookup_addr(addr: &IpAddr) -> io::Result<String> { + net_imp::lookup_addr(addr) +} |
