← all modules
module

stdlib::net::dns

defined in C:\Users\bye45\.glide\bin/src/stdlib/net/dns.glide

Resolve `host` to a list of IP addresses via the system resolver.

fn fn resolve(host: string) -> !*Vector<*IpAddr>

Resolve host to a list of IP addresses via the system resolver. Returns every A and AAAA record the resolver returns, in the order it returned them.

glide
let r: !*Vector<*IpAddr> = resolve("example.com");
if r.ok {
    for let i: int = 0; i < r.val.len(); i++ {
        println!(r.val.get(i).to_string());
    }
}
fn fn resolve_v4(host: string) -> !*Vector<*IpAddr>

Same as resolve but filters to v4 addresses only.

glide
let r: !*Vector<*IpAddr> = resolve_v4("example.com");
if r.ok && r.val.len() > 0 {
    println!("first v4:", r.val.get(0).to_string());
}
fn fn resolve_v6(host: string) -> !*Vector<*IpAddr>

Same as resolve but filters to v6 addresses only.

glide
let r: !*Vector<*IpAddr> = resolve_v6("ipv6.google.com");
if r.ok && r.val.len() > 0 {
    println!("first v6:", r.val.get(0).to_string());
}