M
dns.setDefaultResultOrder
History
Added in: v16.4.0, v14.18.0
v16.4.0, v14.18.0
Introduced in: v0.10.0
v0.10.0
The
ipv6first value is supported now.v22.1.0, v20.13.0
Changed default value to
verbatim.v17.0.0
dns.setDefaultResultOrder(order): void
Attributes
order:
stringmust be
'ipv4first', 'ipv6first' or 'verbatim'.Set the default value of order in dns.lookup() and
dnsPromises.lookup(). The value could be:
ipv4first: sets defaultordertoipv4first.ipv6first: sets defaultordertoipv6first.verbatim: sets defaultordertoverbatim.
The default is verbatim and dns.setDefaultResultOrder() have higher
priority than --dns-result-order. When using worker threads,
dns.setDefaultResultOrder() from the main thread won't affect the default
dns orders in workers.