Skip to main content

Module dns

Module dns 

Source
Expand description

Node dns module.

dns.lookup/dns.promises.lookup use the platform resolver (getaddrinfo, via std::net::ToSocketAddrs) exactly like Node — they honour /etc/hosts. Every resolve*/reverse method is a real DNS query issued through hickory_resolver’s blocking Resolver. Because Node runs its DNS callbacks asynchronously, each query runs on a dedicated std::thread; when it finishes it posts an IoTask back to the main thread which builds the JS record values and fires the Node-style (err, records) callback (or settles the Promise). incr_handle/decr_handle bracket the async op so the event loop stays alive.

A per-thread override list (setServers) and the default result order are module state; dns.Resolver instances carry their own @@servers list on the instance object so instance methods query independent nameservers.

Constants§

METHODS
PROMISES_METHODS
Method surface of a dns.Resolver instance (wired by the parent via instance_has_method("Resolver", …)). dns/promises surface: the shared sync helpers plus every promise-returning resolver. stdlib::call maps each of the latter to dns’s promise<Cap> fn.
RESOLVER_METHODS

Functions§

call
constant
dns.promises nested object plus the numeric flags and string error codes.
construct_resolver
new dns.Resolver() → callback-style resolver instance.
construct_resolver_promises
new dns.promises.Resolver() → Promise-returning resolver instance.
resolver_instance_call
Dispatch an instance method on a dns.Resolver receiver.