Skip to content
FutureBlitz

    Install

    Import std.net.dns

    std.net.dns

    std.net's Dns: the addresses a host's name has, as the OS's resolver finds them, through libuv's getaddrinfo on the runtime's I/O thread, blocking or Async.

    std/net/dns.fb

    Types

    Dns struct

    Public Struct Dns

    Dns's Static Methods.

    std/net/dns.fb, line 18

    • Public Static Method Resolve(host: String): IpAddress[] Throws NetError static method #

      The addresses host has, IPv4 and IPv6, each once, in the order the OS prefers them, from its hosts file and the DNS servers it asks, as getaddrinfo looks them up: "localhost" is the loopback addresses, and an IP address's text is that address. Throws a NetError of HOST_NOT_FOUND for a name with no address, an empty one, one with a NUL, or one too long to look up, of more than 255 bytes, and of OTHER when the lookup fails another way.

    • Public Static Async Method ResolveAsync(host: String): IpAddress[] Throws NetError static method #

      Resolve's Async twin: a Task of host's addresses, which the I/O thread finishes while the main thread goes on, with an array of its own, the code then the addresses.

    Report an issue with this page or with FutureBlitz on GitHub.