method IDnsResolver.resolveHost
IDnsResolver.resolveHost(hostname: string): Promise<readonly string[]>

Resolves a hostname to IP address literals.

Concatenates A and AAAA results. A host with only one family present resolves successfully with just that family's addresses; the lookup rejects only when both families fail.

Parameters

hostname: string

Hostname to resolve

Return Type

Promise<readonly string[]>

IPv4 and IPv6 address literals, possibly empty

Throws

Error

If both address families fail to resolve

Usage

import { type IDnsResolver } from "common/src/index.ts";