mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[node] Restore default Node.js 16 DNS lookup behavior (#163025)
Starting in Node.js 17 the IP address from a DNS lookup resolves in the order returned from the resolver. Prior versions resolve with IPv4 addresses sorted before IPv6 addresses. This restores the previous behavior. In distributions, this can be configured via the `--dns-result-order` flag in `node.options`. Closes #163006 [Node.js 17 changelog](https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V17.md) [Documentation](https://nodejs.org/docs/latest-v18.x/api/cli.html#--dns-result-orderorder) Testing 1) Resolve localhost to 127.0.0.1 and then ::1 in `/etc/hosts` 2) `yarn start`. Logs should indicate connecting to elasticsearch over 127.0.0.1:9200
This commit is contained in:
parent
0843781bab
commit
bd3b54c51d
2 changed files with 7 additions and 0 deletions
|
@ -7,3 +7,6 @@
|
|||
|
||||
## do not terminate process on unhandled promise rejection
|
||||
--unhandled-rejections=warn
|
||||
|
||||
## restore < Node 16 default DNS lookup behavior
|
||||
--dns-result-order=ipv4first
|
||||
|
|
|
@ -8,5 +8,9 @@
|
|||
|
||||
// development env setup includes babel/register after the env is initialized
|
||||
require('./setup_env');
|
||||
|
||||
// restore < Node 16 default DNS lookup behavior
|
||||
require('dns').setDefaultResultOrder('ipv4first');
|
||||
|
||||
require('@kbn/babel-register').install();
|
||||
require('./polyfill');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue