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.Resolverinstance (wired by the parent viainstance_has_method("Resolver", …)).dns/promisessurface: the shared sync helpers plus every promise-returning resolver.stdlib::callmaps each of the latter to dns’spromise<Cap>fn. - RESOLVER_
METHODS
Functions§
- call
- constant
dns.promisesnested 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.Resolverreceiver.