Skip to content

dns.resolve fails when the io/node process starts without an active network connection #1644

@johnthedebs

Description

@johnthedebs

To reproduce:

  1. Disable your Internet connection (this needs to be done first)

  2. Start a io/node repl

  3. 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"); }})

  4. Re-enable your Internet connection

  5. 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.dnsIssues and PRs related to the dns subsystem.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions