@@ -179,6 +179,9 @@ section if a custom port is used.
179179<!-- YAML
180180added: v0.1.90
181181changes:
182+ - version: REPLACEME
183+ pr-url: https://github.com/nodejs/node/pull/52492
184+ description: The `verbatim` option is now deprecated in favor of the new `order` option.
182185 - version: v18.4.0
183186 pr-url: https://github.com/nodejs/node/pull/43054
184187 description: For compatibility with `node:net`, when passing an option
@@ -211,9 +214,18 @@ changes:
211214 flags may be passed by bitwise ` OR ` ing their values.
212215 * ` all ` {boolean} When ` true ` , the callback returns all resolved addresses in
213216 an array. Otherwise, returns a single address. ** Default:** ` false ` .
217+ * ` order ` {string} When ` verbatim ` , the resolved addresses are return
218+ unsorted. When ` ipv4first ` , the resolved addresses are sorted by placing
219+ IPv4 addresses before IPv6 addresses. When ` ipv6first ` , the resolved
220+ addresses are sorted by placing IPv6 addresses before IPv4 addresses.
221+ ** Default:** ` verbatim ` (addresses are not reordered).
222+ Default value is configurable using [ ` dns.setDefaultResultOrder() ` ] [ ] or
223+ [ ` --dns-result-order ` ] [ ] .
214224 * ` verbatim ` {boolean} When ` true ` , the callback receives IPv4 and IPv6
215225 addresses in the order the DNS resolver returned them. When ` false ` ,
216226 IPv4 addresses are placed before IPv6 addresses.
227+ This option will be deprecated in favor of ` order ` . When both are specified,
228+ ` order ` has higher precedence. New code should only use ` order ` .
217229 ** Default:** ` true ` (addresses are not reordered). Default value is
218230 configurable using [ ` dns.setDefaultResultOrder() ` ] [ ] or
219231 [ ` --dns-result-order ` ] [ ] .
@@ -775,18 +787,22 @@ added:
775787 - v16.4.0
776788 - v14.18.0
777789changes:
790+ - version: REPLACEME
791+ pr-url: https://github.com/nodejs/node/pull/52492
792+ description: The `ipv6first` value is supported now.
778793 - version: v17.0.0
779794 pr-url: https://github.com/nodejs/node/pull/39987
780795 description: Changed default value to `verbatim`.
781796-->
782797
783- * ` order ` {string} must be ` 'ipv4first' ` or ` 'verbatim' ` .
798+ * ` order ` {string} must be ` 'ipv4first' ` , ` 'ipv6first' ` or ` 'verbatim' ` .
784799
785- Set the default value of ` verbatim ` in [ ` dns.lookup() ` ] [ ] and
800+ Set the default value of ` order ` in [ ` dns.lookup() ` ] [ ] and
786801[ ` dnsPromises.lookup() ` ] [ ] . The value could be:
787802
788- * ` ipv4first ` : sets default ` verbatim ` ` false ` .
789- * ` verbatim ` : sets default ` verbatim ` ` true ` .
803+ * ` ipv4first ` : sets default ` order ` to ` ipv4first ` .
804+ * ` ipv6first ` : sets default ` order ` to ` ipv6first ` .
805+ * ` verbatim ` : sets default ` order ` to ` verbatim ` .
790806
791807The default is ` verbatim ` and [ ` dns.setDefaultResultOrder() ` ] [ ] have higher
792808priority than [ ` --dns-result-order ` ] [ ] . When using [ worker threads] [ ] ,
@@ -799,13 +815,18 @@ dns orders in workers.
799815added:
800816 - v20.1.0
801817 - v18.17.0
818+ changes:
819+ - version: REPLACEME
820+ pr-url: https://github.com/nodejs/node/pull/52492
821+ description: The `ipv6first` value is supported now.
802822-->
803823
804- Get the default value for ` verbatim ` in [ ` dns.lookup() ` ] [ ] and
824+ Get the default value for ` order ` in [ ` dns.lookup() ` ] [ ] and
805825[ ` dnsPromises.lookup() ` ] [ ] . The value could be:
806826
807- * ` ipv4first ` : for ` verbatim ` defaulting to ` false ` .
808- * ` verbatim ` : for ` verbatim ` defaulting to ` true ` .
827+ * ` ipv4first ` : for ` order ` defaulting to ` ipv4first ` .
828+ * ` ipv6first ` : for ` order ` defaulting to ` ipv6first ` .
829+ * ` verbatim ` : for ` order ` defaulting to ` verbatim ` .
809830
810831## ` dns.setServers(servers) `
811832
@@ -949,6 +970,10 @@ section if a custom port is used.
949970
950971<!-- YAML
951972added: v10.6.0
973+ changes:
974+ - version: REPLACEME
975+ pr-url: https://github.com/nodejs/node/pull/52492
976+ description: The `verbatim` option is now deprecated in favor of the new `order` option.
952977-->
953978
954979* ` hostname ` {string}
@@ -961,13 +986,22 @@ added: v10.6.0
961986 flags may be passed by bitwise ` OR ` ing their values.
962987 * ` all ` {boolean} When ` true ` , the ` Promise ` is resolved with all addresses in
963988 an array. Otherwise, returns a single address. ** Default:** ` false ` .
989+ * ` order ` {string} When ` verbatim ` , the ` Promise ` is resolved with IPv4 and
990+ IPv6 addresses in the order the DNS resolver returned them. When ` ipv4first ` ,
991+ IPv4 addresses are placed before IPv6 addresses. When ` ipv6first ` ,
992+ IPv6 addresses are placed before IPv4 addresses.
993+ ** Default:** ` verbatim ` (addresses are not reordered).
994+ Default value is configurable using [ ` dns.setDefaultResultOrder() ` ] [ ] or
995+ [ ` --dns-result-order ` ] [ ] . New code should use ` { order: 'verbatim' } ` .
964996 * ` verbatim ` {boolean} When ` true ` , the ` Promise ` is resolved with IPv4 and
965997 IPv6 addresses in the order the DNS resolver returned them. When ` false ` ,
966998 IPv4 addresses are placed before IPv6 addresses.
999+ This option will be deprecated in favor of ` order ` . When both are specified,
1000+ ` order ` has higher precedence. New code should only use ` order ` .
9671001 ** Default:** currently ` false ` (addresses are reordered) but this is
9681002 expected to change in the not too distant future. Default value is
9691003 configurable using [ ` dns.setDefaultResultOrder() ` ] [ ] or
970- [ ` --dns-result-order ` ] [ ] . New code should use ` { verbatim: true } ` .
1004+ [ ` --dns-result-order ` ] [ ] .
9711005
9721006Resolves a host name (e.g. ` 'nodejs.org' ` ) into the first found A (IPv4) or
9731007AAAA (IPv6) record. All ` option ` properties are optional. If ` options ` is an
@@ -1349,18 +1383,22 @@ added:
13491383 - v16.4.0
13501384 - v14.18.0
13511385changes:
1386+ - version: REPLACEME
1387+ pr-url: https://github.com/nodejs/node/pull/52492
1388+ description: The `ipv6first` value is supported now.
13521389 - version: v17.0.0
13531390 pr-url: https://github.com/nodejs/node/pull/39987
13541391 description: Changed default value to `verbatim`.
13551392-->
13561393
1357- * ` order ` {string} must be ` 'ipv4first' ` or ` 'verbatim' ` .
1394+ * ` order ` {string} must be ` 'ipv4first' ` , ` 'ipv6first' ` or ` 'verbatim' ` .
13581395
1359- Set the default value of ` verbatim ` in [ ` dns.lookup() ` ] [ ] and
1396+ Set the default value of ` order ` in [ ` dns.lookup() ` ] [ ] and
13601397[ ` dnsPromises.lookup() ` ] [ ] . The value could be:
13611398
1362- * ` ipv4first ` : sets default ` verbatim ` ` false ` .
1363- * ` verbatim ` : sets default ` verbatim ` ` true ` .
1399+ * ` ipv4first ` : sets default ` order ` to ` ipv4first ` .
1400+ * ` ipv6first ` : sets default ` order ` to ` ipv6first ` .
1401+ * ` verbatim ` : sets default ` order ` to ` verbatim ` .
13641402
13651403The default is ` verbatim ` and [ ` dnsPromises.setDefaultResultOrder() ` ] [ ] have
13661404higher priority than [ ` --dns-result-order ` ] [ ] . When using [ worker threads] [ ] ,
0 commit comments