Uh oh!
There was an error while loading. Please reload this page.
dns: add verbatim option to dns.lookup() - #14731
Conversation
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. Refs: nodejs#6307
refack
commented
Aug 10, 2017
IMHO we should also add an environment flag that changes the default, for upstream users of 3rd party packages. |
| 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 }`. |
There was a problem hiding this comment.
I don't have a strong opinion on preferring verbatim: true, but shouldn't we add a runtime deprecation of the old default?
There was a problem hiding this comment.
That seems like a separate question to "should this be an option". This is semver-minor (I think), and could be backported to v6.x. A runtime deprecation would be major.
There was a problem hiding this comment.
Documentation-only deprecation would be better, I think. We're not likely to get rid of the default, just change it. A runtime deprecation would be too noisy.
gibfahn
commented
Aug 10, 2017
Or a command line flag that works with |
cjihrig
left a comment
There was a problem hiding this comment.
LGTM
Suggestions on how to test this properly welcome.
Could the new DNS functionality in test/common/dns.js be used?
bnoordhuis
commented
Aug 10, 2017
I don't think so. Node doesn't have control over what |
gibfahn
commented
Aug 10, 2017
I guess we could monkey-patch the |
bnoordhuis
commented
Aug 10, 2017
Yes. The call site is in libuv so yeah. |
| const cares = process.binding('cares_wrap'); | ||
| const req = new cares.GetAddrInfoReqWrap(); | ||
| cares.getaddrinfo(req, 'nodejs.org', 4); | ||
| cares.getaddrinfo(req, 'nodejs.org', 4, /* hints */ 0, /* verbatim */ true); |
There was a problem hiding this comment.
You could compare results to python -c "import socket ; a = socket.getaddrinfo('nodejs.org', None); print(a)"
There was a problem hiding this comment.
That assumes python's implementation is exactly the same as node's, though. If it's not, or worse, not always, it's going to be a right pain in the neck to debug.
If you still think it's a good idea, can you file a separate issue to hash out the details?
bnoordhuis
commented
Aug 17, 2017
jasnell
commented
Aug 23, 2017
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: #14731 Ref: #6307 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell
commented
Aug 23, 2017
Landed in e007f66 |
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: nodejs/node#14731 Ref: nodejs/node#6307 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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: nodejs/node#14731 Ref: nodejs/node#6307 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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: #14731 Ref: #6307 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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: #14731 Ref: #6307 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
commented
Sep 12, 2017
Is this semver minor? |
bnoordhuis
commented
Sep 12, 2017
@MylesBorins Yes, semver-minor. |
Notable Changes * build: * Snapshots are now re-enabled in V8 #14875 * console: * Implement minimal `console.group()`. #14910 * deps: * upgrade libuv to 1.14.1 #14866 * update nghttp2 to v1.25.0 #14955 * 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. #14731 * fs: * add fs.copyFile and fs.copyFileSync which allows for more efficient copying of files. #15034 * inspector: * Enable async stack traces #13870 * module: * Add support for ESM. This is currently behind the `--experimental-modules` flag and requires the .mjs extension. `node --experimental-modules index.mjs` #14369 * napi: * implement promise #14365 * os: * Add support for CIDR notation to the output of the networkInterfaces() method. #14307 * perf_hooks: * An initial implementation of the Performance Timing API for Node.js. This is the same Performance Timing API implemented by modern browsers with a number of Node.js specific properties. The User Timing mark() and measure() APIs are implemented, as is a Node.js specific flavor of the Frame Timing for measuring event loop duration. #14680 * tls: * multiple PFX in createSecureContext [#14793](#14793) * Added new collaborators: * BridgeAR – Ruben Bridgewater PR-URL: #15308
Notable Changes * build: * Snapshots are now re-enabled in V8 #14875 * console: * Implement minimal `console.group()`. #14910 * deps: * upgrade libuv to 1.14.1 #14866 * update nghttp2 to v1.25.0 #14955 * 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. #14731 * fs: * add fs.copyFile and fs.copyFileSync which allows for more efficient copying of files. #15034 * inspector: * Enable async stack traces #13870 * module: * Add support for ESM. This is currently behind the `--experimental-modules` flag and requires the .mjs extension. `node --experimental-modules index.mjs` #14369 * napi: * implement promise #14365 * os: * Add support for CIDR notation to the output of the networkInterfaces() method. #14307 * perf_hooks: * An initial implementation of the Performance Timing API for Node.js. This is the same Performance Timing API implemented by modern browsers with a number of Node.js specific properties. The User Timing mark() and measure() APIs are implemented, as is a Node.js specific flavor of the Frame Timing for measuring event loop duration. #14680 * tls: * multiple PFX in createSecureContext [#14793](#14793) * Added new collaborators: * BridgeAR – Ruben Bridgewater PR-URL: #15308
Notable Changes * build: * Snapshots are now re-enabled in V8 nodejs#14875 * console: * Implement minimal `console.group()`. nodejs#14910 * deps: * upgrade libuv to 1.14.1 nodejs#14866 * update nghttp2 to v1.25.0 nodejs#14955 * 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. nodejs#14731 * fs: * add fs.copyFile and fs.copyFileSync which allows for more efficient copying of files. nodejs#15034 * inspector: * Enable async stack traces nodejs#13870 * module: * Add support for ESM. This is currently behind the `--experimental-modules` flag and requires the .mjs extension. `node --experimental-modules index.mjs` nodejs#14369 * napi: * implement promise nodejs#14365 * os: * Add support for CIDR notation to the output of the networkInterfaces() method. nodejs#14307 * perf_hooks: * An initial implementation of the Performance Timing API for Node.js. This is the same Performance Timing API implemented by modern browsers with a number of Node.js specific properties. The User Timing mark() and measure() APIs are implemented, as is a Node.js specific flavor of the Frame Timing for measuring event loop duration. nodejs#14680 * tls: * multiple PFX in createSecureContext [nodejs#14793](nodejs#14793) * Added new collaborators: * BridgeAR – Ruben Bridgewater PR-URL: nodejs#15308
Added flag with NODE_OPTIONS whitelist to allow preserving lookup order as retrieved from resolver. Still allows individual lookup requests with verbatim flag assigned explicitly to override the config flag. Open for suggestions on how to craft a test for this. Refs: nodejs#14731 (comment)
gibfahn
commented
Jan 15, 2018
Release team decided not to land on v6.x, if you disagree let us know. |
bnoordhuis
commented
Jan 17, 2018
@gibfahn I think it would be useful to have this in v6.x. The plan is to make |
gibfahn
commented
Jan 18, 2018
cc/ @nodejs/lts , what do you think? If we're going to include this we should decide before next Tuesday. |
MylesBorins
commented
Jan 22, 2018
via email
If you think it is useful and can open a backport I don't object to it
landing …On Jan 18, 2018 11:59 AM, "Gibson Fahnestock" ***@***.***> wrote:
cc/ @nodejs/lts <https://github.com/orgs/nodejs/teams/lts> , what do you
think? If we're going to include this we should decide before next Tuesday.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14731 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAecV07zy_g29SK_hJX6MG_VX-Fnme3Fks5tL3hZgaJpZM4OzLuW>
.
|
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.
Refs: #6307
Suggestions on how to test this properly welcome.