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
* @deprecated Since v20.13.0 Calling `Hmac` class directly with `Hmac()` or `new Hmac()` is deprecated due to being internals, not intended for public use. Please use the {@link createHmac} method to create Hmac instances.
Copy file name to clipboardExpand all lines: types/node/dns.d.ts
+23-12Lines changed: 23 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@
42
42
* ```
43
43
*
44
44
* See the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) for more information.
* The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons,`'IPv4'` and `'IPv6'` are interpreted
67
+
* The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons,`'IPv4'` and `'IPv6'` are interpreted
68
68
* as `4` and `6` respectively. The value 0 indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used
69
69
* with `{ all: true } (see below)`, both IPv4 and IPv6 addresses are returned.
70
70
* @default 0
@@ -80,9 +80,18 @@ 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-v20.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()}
93
+
* addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified,
94
+
* `order` has higher precedence. New code should only use `order`. Default value is configurable using {@link setDefaultResultOrder}
86
95
* or [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
* Get the default value for `verbatim` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
675
+
* Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
667
676
* The value could be:
668
677
*
669
-
* * `ipv4first`: for `verbatim` defaulting to `false`.
670
-
* * `verbatim`: for `verbatim` defaulting to `true`.
678
+
* * `ipv4first`: for `order` defaulting to `ipv4first`.
679
+
* * `ipv6first`: for `order` defaulting to `ipv6first`.
680
+
* * `verbatim`: for `order` defaulting to `verbatim`.
* Sets the IP address and port of servers to be used when performing DNS
676
686
* resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
@@ -717,20 +727,21 @@ declare module "dns" {
717
727
*/
718
728
exportfunctiongetServers(): string[];
719
729
/**
720
-
* Set the default value of `verbatim` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
730
+
* Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
721
731
* The value could be:
722
732
*
723
-
* * `ipv4first`: sets default `verbatim` `false`.
724
-
* * `verbatim`: sets default `verbatim` `true`.
733
+
* * `ipv4first`: sets default `order` to `ipv4first`.
734
+
* * `ipv6first`: sets default `order` to `ipv6first`.
735
+
* * `verbatim`: sets default `order` to `verbatim`.
725
736
*
726
737
* The default is `verbatim` and {@link setDefaultResultOrder} have higher
727
738
* priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). When using
728
739
* [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
729
740
* thread won't affect the default dns orders in workers.
730
741
* @since v16.4.0, v14.18.0
731
-
* @param order must be `'ipv4first'` or `'verbatim'`.
742
+
* @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
0 commit comments