Closed
Description
To reproduce:
-
Disable your Internet connection (this needs to be done first)
-
Start a io/node repl
-
Enter the following into the repl and note that it fails with
ECONNREFUSED
:var dns = require("dns");
dns.resolve("google.com", function(err) { if (err) { console.log(err); } else { console.log("online"); }}) -
Re-enable your Internet connection
-
Run
dns.resolve("google.com", function(err) { if (err) { console.log(err); } else { console.log("online"); }})
again, and note that it still fails
If the process starts before the Internet connection is disabled, it will work as expected once the connection is re-enabled.
For what it's worth, this bug doesn't affect dns.lookup
(which according to the docs is implemented differently than dns.resolve
).