Function std::net::lookup_hostUnstable [-] [+] [src]

pub fn lookup_host(host: &str) -> Result<LookupHost>

Resolve the host specified by host as a number of SocketAddr instances.

This method may perform a DNS query to resolve host and may also inspect system configuration to resolve the specified hostname.

Example

fn main() { use std::net; fn foo() -> std::io::Result<()> { for host in try!(net::lookup_host("rust-lang.org")) { println!("found address: {}", try!(host)); } Ok(()) } }
use std::net;

for host in try!(net::lookup_host("rust-lang.org")) {
    println!("found address: {}", try!(host));
}