From e007f66ae211192f385dc253bfa19a84e7fc649a Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 10 Aug 2017 11:19:13 +0200 Subject: dns: add `verbatim` option to dns.lookup() When true, results from the DNS resolver are passed on as-is, without the reshuffling that Node.js otherwise does that puts IPv4 addresses before IPv6 addresses. PR-URL: https://github.com/nodejs/node/pull/14731 Ref: https://github.com/nodejs/node/issues/6307 Reviewed-By: Refael Ackermann Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- doc/api/dns.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/api/dns.md') diff --git a/doc/api/dns.md b/doc/api/dns.md index 0d191af15e..46927e5f52 100644 --- a/doc/api/dns.md +++ b/doc/api/dns.md @@ -140,6 +140,12 @@ changes: flags may be passed by bitwise `OR`ing their values. - `all` {boolean} When `true`, the callback returns all resolved addresses in an array. Otherwise, returns a single address. Defaults to `false`. + - `verbatim` {boolean} When `true`, the callback receives IPv4 and IPv6 + addresses in the order the DNS resolver returned them. When `false`, + IPv4 addresses are placed before IPv6 addresses. + Default: currently `false` (addresses are reordered) but this is expected + to change in the not too distant future. + New code should use `{ verbatim: true }`. - `callback` {Function} - `err` {Error} - `address` {string} A string representation of an IPv4 or IPv6 address. -- cgit v1.2.3