@@ -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 has been replaced with the `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,11 +214,12 @@ 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 ` .
214- * ` verbatim ` {boolean} When ` true ` , the callback receives IPv4 and IPv6
215- addresses in the order the DNS resolver returned them. When ` false ` ,
216- IPv4 addresses are placed before IPv6 addresses.
217- ** Default:** ` true ` (addresses are not reordered). Default value is
218- configurable using [ ` dns.setDefaultResultOrder() ` ] [ ] or
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
219223 [ ` --dns-result-order ` ] [ ] .
220224* ` callback ` {Function}
221225 * ` err ` {Error}
@@ -775,18 +779,22 @@ added:
775779 - v16.4.0
776780 - v14.18.0
777781changes:
782+ - version: REPLACEME
783+ pr-url: https://github.com/nodejs/node/pull/52492
784+ description: The `ipv6first` value is supported now.
778785 - version: v17.0.0
779786 pr-url: https://github.com/nodejs/node/pull/39987
780787 description: Changed default value to `verbatim`.
781788-->
782789
783- * ` order ` {string} must be ` 'ipv4first' ` or ` 'verbatim' ` .
790+ * ` order ` {string} must be ` 'ipv4first' ` , ` 'ipv6first' ` or ` 'verbatim' ` .
784791
785- Set the default value of ` verbatim ` in [ ` dns.lookup() ` ] [ ] and
792+ Set the default value of ` order ` in [ ` dns.lookup() ` ] [ ] and
786793[ ` dnsPromises.lookup() ` ] [ ] . The value could be:
787794
788- * ` ipv4first ` : sets default ` verbatim ` ` false ` .
789- * ` verbatim ` : sets default ` verbatim ` ` true ` .
795+ * ` ipv4first ` : sets default ` order ` to ` ipv4first ` .
796+ * ` ipv6first ` : sets default ` order ` to ` ipv6first ` .
797+ * ` verbatim ` : sets default ` order ` to ` verbatim ` .
790798
791799The default is ` verbatim ` and [ ` dns.setDefaultResultOrder() ` ] [ ] have higher
792800priority than [ ` --dns-result-order ` ] [ ] . When using [ worker threads] [ ] ,
@@ -799,13 +807,18 @@ dns orders in workers.
799807added:
800808 - v20.1.0
801809 - v18.17.0
810+ changes:
811+ - version: REPLACEME
812+ pr-url: https://github.com/nodejs/node/pull/52492
813+ description: The `ipv6first` value is supported now.
802814-->
803815
804- Get the default value for ` verbatim ` in [ ` dns.lookup() ` ] [ ] and
816+ Get the default value for ` order ` in [ ` dns.lookup() ` ] [ ] and
805817[ ` dnsPromises.lookup() ` ] [ ] . The value could be:
806818
807- * ` ipv4first ` : for ` verbatim ` defaulting to ` false ` .
808- * ` verbatim ` : for ` verbatim ` defaulting to ` true ` .
819+ * ` ipv4first ` : for ` order ` defaulting to ` ipv4first ` .
820+ * ` ipv6first ` : for ` order ` defaulting to ` ipv6first ` .
821+ * ` verbatim ` : for ` order ` defaulting to ` verbatim ` .
809822
810823## ` dns.setServers(servers) `
811824
@@ -949,6 +962,10 @@ section if a custom port is used.
949962
950963<!-- YAML
951964added: v10.6.0
965+ changes:
966+ - version: REPLACEME
967+ pr-url: https://github.com/nodejs/node/pull/52492
968+ description: The verbatim option has been replaced by the `order` option.
952969-->
953970
954971* ` hostname ` {string}
@@ -961,13 +978,13 @@ added: v10.6.0
961978 flags may be passed by bitwise ` OR ` ing their values.
962979 * ` all ` {boolean} When ` true ` , the ` Promise ` is resolved with all addresses in
963980 an array. Otherwise, returns a single address. ** Default:** ` false ` .
964- * ` verbatim ` {boolean } When ` true ` , the ` Promise ` is resolved with IPv4 and
965- IPv6 addresses in the order the DNS resolver returned them. When ` false ` ,
966- IPv4 addresses are placed before IPv6 addresses.
967- ** Default: ** currently ` false ` ( addresses are reordered) but this is
968- expected to change in the not too distant future. Default value is
969- configurable using [ ` dns.setDefaultResultOrder() ` ] [ ] or
970- [ ` --dns-result-order ` ] [ ] . New code should use ` { verbatim: true } ` .
981+ * ` order ` {string } When ` verbatim ` , the ` Promise ` is resolved with IPv4 and
982+ IPv6 addresses in the order the DNS resolver returned them. When ` ipv4first ` ,
983+ IPv4 addresses are placed before IPv6 addresses. When ` ipv6first ` ,
984+ IPv6 addresses are placed before IPv4 addresses.
985+ ** Default: ** ` verbatim ` (addresses are not reordered).
986+ Default value is configurable using [ ` dns.setDefaultResultOrder() ` ] [ ] or
987+ [ ` --dns-result-order ` ] [ ] . New code should use ` { order: 'verbatim' } ` .
971988
972989Resolves a host name (e.g. ` 'nodejs.org' ` ) into the first found A (IPv4) or
973990AAAA (IPv6) record. All ` option ` properties are optional. If ` options ` is an
@@ -1349,18 +1366,22 @@ added:
13491366 - v16.4.0
13501367 - v14.18.0
13511368changes:
1369+ - version: REPLACEME
1370+ pr-url: https://github.com/nodejs/node/pull/52492
1371+ description: The `ipv6first` value is supported now.
13521372 - version: v17.0.0
13531373 pr-url: https://github.com/nodejs/node/pull/39987
13541374 description: Changed default value to `verbatim`.
13551375-->
13561376
1357- * ` order ` {string} must be ` 'ipv4first' ` or ` 'verbatim' ` .
1377+ * ` order ` {string} must be ` 'ipv4first' ` , ` 'ipv6first' ` or ` 'verbatim' ` .
13581378
1359- Set the default value of ` verbatim ` in [ ` dns.lookup() ` ] [ ] and
1379+ Set the default value of ` order ` in [ ` dns.lookup() ` ] [ ] and
13601380[ ` dnsPromises.lookup() ` ] [ ] . The value could be:
13611381
1362- * ` ipv4first ` : sets default ` verbatim ` ` false ` .
1363- * ` verbatim ` : sets default ` verbatim ` ` true ` .
1382+ * ` ipv4first ` : sets default ` order ` to ` ipv4first ` .
1383+ * ` ipv6first ` : sets default ` order ` to ` ipv6first ` .
1384+ * ` verbatim ` : sets default ` order ` to ` verbatim ` .
13641385
13651386The default is ` verbatim ` and [ ` dnsPromises.setDefaultResultOrder() ` ] [ ] have
13661387higher priority than [ ` --dns-result-order ` ] [ ] . When using [ worker threads] [ ] ,
0 commit comments