Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

DenoDns

Deno-backed implementation of Effect's Dns service.

Address lookups use the operating system resolver through Deno's node:dns compatibility layer, so they also read the hosts file. Record queries and reverse lookups use Deno.resolveDns and can be cancelled by interruption. Records whose data cannot be represented, such as names that are not valid Host.DomainName values, are skipped, and a query fails with InvalidResponse when every record is skipped.

Gotchas

Deno.resolveDns reports every error response from the name server with the same error as a missing name, so refused queries and server failures (REFUSED, SERVFAIL, FORMERR, NOTIMP) fail with NotFound instead of Refused, ServerFailure, InvalidResponse, or Unsupported. Server failures are therefore not reported as temporary. Deno.resolveDns cannot query TLSA records, so TLSA queries fail with Unsupported. Queries require the --allow-net permission.

4 exports Since v4.0.0 Source

Constructors

Since v4.0.0

Creates a Deno Dns service.

Signature

declare const make: (...args: [options?: Options]) => Effect<any, unknown, never>

Layers

Since v4.0.0

Layer that provides the Deno Dns service using the system resolver configuration.

Signature

declare const layer: Layer.Layer<Dns.Dns>

Creates a layer that provides the Deno Dns service with options read from configuration.

Signature

declare function layerConfig(options: {
readonly nameServer?: Config<any>;
} | Config<Options>): Layer<Dns, ConfigError | NetAddressError>

Models

Options

interface
Since v4.0.0

Options for the Deno Dns service.

Details

nameServer replaces the system name server for record queries and reverse lookups and is converted like Dns.nameServerFromInput. Address lookups always use the operating system resolver.

Gotchas

Invalid name servers fail with a NetAddress.NetAddressError when the service is created, and so do IPv6 name servers with a scope ID, such as link-local addresses.

Signature

interface Options {
readonly nameServer?: any;
}