Standard library
DNS
Host name lookup.
Introduction
Host name lookup. Import std/net/dns to bind the module as dns. Call free functions as dns.name(...). Struct methods use a receiver value.
/ std/net/dns
This page is the package reference for std/net/dns. Private helpers used only by co-located tests are not listed.
Functions
Free functions on dns. Each function has a short description, an example, then parameters and return shape.
lookup
Resolves a host name to address strings. Call form: dns.lookup(host).
/ std/net/dns
$ addrs = dns.lookup("localhost")Parameters: host: host name. Returns: List of address strings.