Skip to main content
promises.setDefaultResultOrder - dns - Node documentation
function promises.setDefaultResultOrder

Usage in Deno

import { promises } from "node:dns";
setDefaultResultOrder(order:
"ipv4first"
| "ipv6first"
| "verbatim"
): void

Set the default value of order in dns.lookup() and [lookup](../.././dns/~/promises.lookup). The value could be:

  • ipv4first: sets default order to ipv4first.
  • ipv6first: sets default order to ipv6first.
  • verbatim: sets default order to verbatim.

The default is verbatim and dnsPromises.setDefaultResultOrder() have higher priority than --dns-result-order. When using worker threads, dnsPromises.setDefaultResultOrder() from the main thread won't affect the default dns orders in workers.

Parameters

order:
"ipv4first"
| "ipv6first"
| "verbatim"

must be 'ipv4first', 'ipv6first' or 'verbatim'.

Return Type

void
Back to top