OxL Reference

data dns

Namespace of name resolution functions.

Example:

oxl✓ checked in CI
use std.net { dns, IpAddr }

fn main() io, net {
  match dns.lookup("127.0.0.1") {
    List<IpAddr> ips => print(ips[0].toString())
    NetError _ => print("failed")
  }
}
Output
127.0.0.1
pub(api) data dns

Since. 1.0.0-beta

Methods

lookup(host: str, timeout: Duration?) -> List<IpAddr> | NetError net
All IPv4 / IPv6 addresses of host (a name or a numeric address), in resolver order.

Defined in: std/net/net.oxl:740

See also