Skip to main content
promises.setDefaultResultOrder - node__dns.d.ts - Node documentation
function promises.setDefaultResultOrder

Usage in Deno

```typescript import { promises } from "node:node__dns.d.ts"; ```
setDefaultResultOrder(order:
"ipv4first"
| "ipv6first"
| "verbatim"
): void
Set the default value of `order` in `dns.lookup()` and `[lookup](../.././node__dns.d.ts/~/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()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder) have higher priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). When using [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), [`dnsPromises.setDefaultResultOrder()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder) 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