diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2017-08-10 11:19:13 +0200 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-08-23 14:53:47 -0700 |
commit | e007f66ae211192f385dc253bfa19a84e7fc649a (patch) | |
tree | 987b0ec77b0af63a82709ee09f3230ad3f4bc6bb /doc/api/dns.md | |
parent | cbd3708c85e13b234e9ded0beaaf1780a537dc39 (diff) | |
download | android-node-v8-e007f66ae211192f385dc253bfa19a84e7fc649a.tar.gz android-node-v8-e007f66ae211192f385dc253bfa19a84e7fc649a.tar.bz2 android-node-v8-e007f66ae211192f385dc253bfa19a84e7fc649a.zip |
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 <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/dns.md')
-rw-r--r-- | doc/api/dns.md | 6 |
1 files changed, 6 insertions, 0 deletions
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. |