# Function std::net::lookup_host [−] [src]

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

Deprecated since 1.25

: Use the ToSocketAddrs trait instead

🔬 This is a nightly-only experimental API. (`lookup_host` #27705)

unsure about the returned iterator and returning socket addresses

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.

The returned iterator will skip over any unknown addresses returned by the operating system.

# Examples

    #![feature(lookup_host)]

    use std::net;

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

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)