Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core DNS bug affecting all Node.js versions when behind VPN #33353

Closed
niftylettuce opened this issue May 11, 2020 · 7 comments
Closed

Core DNS bug affecting all Node.js versions when behind VPN #33353

niftylettuce opened this issue May 11, 2020 · 7 comments
Labels
dns Issues and PRs related to the dns subsystem.

Comments

@niftylettuce
Copy link

Run this code below as node example.js when you're behind a VPN and the script will never finish. DNS timeouts will not occur. Not sure what the culprit is - if I can help debug just let me know what I need to do.

const dns = require('dns');

dns.setServers(['1.1.1.1']);
dns.promises.resolveTxt('forwardemail.net').then(console.log).catch(console.error);
dns.setServers(['1.1.1.1']);
dns.promises.resolveTxt('example.com').then(console.log).catch(console.error);
@niftylettuce
Copy link
Author

Possibly related to #14086

@bnoordhuis bnoordhuis added the dns Issues and PRs related to the dns subsystem. label May 11, 2020
@bnoordhuis
Copy link
Member

Can you clarify whether you're only seeing that with the promisified API or with the callback-based one too?

@niftylettuce
Copy link
Author

It occurs with both @bnoordhuis

@bnoordhuis
Copy link
Member

I'm not having luck reproducing it locally. If you want to investigate, I'd probably start by checking with gdb whether ares_sockstate_cb and ChannelWrap::AresTimeout in src/cares_wrap are called (and how often.)

What kind of traffic do you see with tcpdump? What does it look like when you run node through strace?

@niftylettuce
Copy link
Author

@bnoordhuis I'm not sure what to filter out for when running sudo tcpdump, and I'm guessing for gdb I have to build Node from source?

I've emailed you at info@bnoordhuis.nl with more information.

@bnoordhuis
Copy link
Member

For posterity: there's a 75 second timeout.

Local testing with a blackholed DNS server shows that c-ares internally retries four times (with 5, 10, 20 and 40 second timeouts) before giving up with an ARES_ETIMEDOUT error.

@niftylettuce
Copy link
Author

Got it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dns Issues and PRs related to the dns subsystem.
Projects
None yet
Development

No branches or pull requests

2 participants