Skip to content

DNS requests do not timeout #39562

@nemanjan00

Description

@nemanjan00

Version

v16.5.0

Platform

Linux terminator 5.13.5-zen1-1-zen #1 ZEN SMP PREEMPT Sun, 25 Jul 2021 18:03:00 +0000 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

Run this code:

const dns = require("dns");

const resolver = new dns.Resolver({
	timeout: 5 * 1000
});

resolver.setServers([
	"123.123.123.123"
]);


resolver.resolve4("myip.opendns.com", (error, ip) => {
	console.log(error, ip);
});

How often does it reproduce? Is there a required condition?

It fails every single time

What is the expected behavior?

dns.TIMEOUT is returned as error in callback.

What do you see instead?

Request never times out.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    dnsIssues and PRs related to the dns subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions