You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: types/node/dns.d.ts
+24-11Lines changed: 24 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -80,11 +80,21 @@ declare module "dns" {
80
80
* @default false
81
81
*/
82
82
all?: boolean|undefined;
83
+
/**
84
+
* When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted
85
+
* by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6
86
+
* addresses before IPv4 addresses. Default value is configurable using
87
+
* {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--dns-result-orderorder).
88
+
* @default `verbatim` (addresses are not reordered)
* When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4
85
-
* addresses are placed before IPv6 addresses. Default value is configurable using {@link setDefaultResultOrder}
86
-
* or [`--dns-result-order`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--dns-result-orderorder).
87
-
* @default true
94
+
* addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified,
95
+
* `order` has higher precedence. New code should only use `order`. Default value is configurable using {@link setDefaultResultOrder}
* Get the default value for `verbatim` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options).
676
+
* Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options).
667
677
* The value could be:
668
678
*
669
-
* * `ipv4first`: for `verbatim` defaulting to `false`.
670
-
* * `verbatim`: for `verbatim` defaulting to `true`.
679
+
* * `ipv4first`: for `order` defaulting to `ipv4first`.
680
+
* * `ipv6first`: for `order` defaulting to `ipv6first`.
681
+
* * `verbatim`: for `order` defaulting to `verbatim`.
* Sets the IP address and port of servers to be used when performing DNS
676
687
* resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
@@ -717,19 +728,21 @@ declare module "dns" {
717
728
*/
718
729
exportfunctiongetServers(): string[];
719
730
/**
720
-
* Set the default value of `verbatim` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options).
731
+
* Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options).
721
732
* The value could be:
722
733
*
723
-
* * `ipv4first`: sets default `verbatim` to `false`.
724
-
* * `verbatim`: sets default `verbatim` to `true`.
734
+
* * `ipv4first`: sets default `order` to `ipv4first`.
735
+
* * `ipv6first`: sets default `order` to `ipv6first`.
736
+
* * `verbatim`: sets default `order` to `verbatim`.
725
737
*
726
738
* The default is `verbatim` and {@link setDefaultResultOrder} have higher
727
739
* priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--dns-result-orderorder). When using
728
740
* [worker threads](https://nodejs.org/docs/latest-v22.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
729
741
* thread won't affect the default dns orders in workers.
730
742
* @since v16.4.0, v14.18.0
743
+
* @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
* Set the default value of `verbatim` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options).
350
-
* The value could be:
349
+
* Set the default value of `order` in `dns.lookup()` and `{@link lookup}`. The value could be:
351
350
*
352
-
* * `ipv4first`: sets default `verbatim` to `false`.
353
-
* * `verbatim`: sets default `verbatim` to `true`.
351
+
* * `ipv4first`: sets default `order` to `ipv4first`.
352
+
* * `ipv6first`: sets default `order` to `ipv6first`.
353
+
* * `verbatim`: sets default `order` to `verbatim`.
354
354
*
355
-
* The default is `verbatim` and {@linksetDefaultResultOrder} have higher
356
-
* priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--dns-result-orderorder). When using
357
-
* [worker threads](https://nodejs.org/docs/latest-v22.x/api/worker_threads.html), {@linksetDefaultResultOrder} from the main
358
-
* thread won't affect the default dns orders in workers.
355
+
* The default is `verbatim` and [dnsPromises.setDefaultResultOrder()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder)
356
+
* have higher priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
357
+
* 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)
358
+
* from the main thread won't affect the default dns orders in workers.
359
359
* @since v16.4.0, v14.18.0
360
-
* @param order must be `'ipv4first'` or `'verbatim'`.
360
+
* @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
* Parses a string as a URL. If `base` is provided, it will be used as the base URL for the purpose of resolving non-absolute `input` URLs.
450
+
* Returns `null` if `input` is not a valid.
451
+
* @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is
452
+
* `converted to a string` first.
453
+
* @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first.
0 commit comments