interface IDnsResolver
Since 0.2.0

DNS resolution, abstracted across runtimes.

Exposed as the optional IRuntimeServices.dns. fetch cannot express an SRV lookup, which is how Consul DNS, Kubernetes headless services, and ECS Service Connect are actually consumed — hence a resolver seam rather than making callers reach for a runtime global.

Methods

resolveSrv(hostname: string): Promise<readonly SrvRecord[]>

Resolves SRV records for a hostname.

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.

Usage

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