You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux crux 5.10.59 #2 SMP Sun Aug 15 09:05:30 EDT 2021 i686 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
This code will eventually fail with a timeout, as if it didn't get any replies. However, the A query is sent to localhost and the local DNS server (BIND) replies immediately (as confirmed with both tcpdump and strace), every time it retries the query. However, it seems as if node is discarding the response for some reason.
var dns = require('dns');
dns.setServers(['0.0.0.0']);
dns.resolve('my.host.name', 'A', function (err, records) {});
Changing the DNS server to 127.0.0.1 (or any specific IP) works fine. Changing the nameserver line in /etc/resolv.conf and omitting the call to setServers() works exactly the same.
glibc is fine with "nameserver 0.0.0.0" in /etc/resolv.conf. I've never seen anything else fail like this, or care. (I understand that doesn't mean it's right!)
If node claimed 0.0.0.0 was invalid, or refused/failed to send the query, I would accept that as intended behavior. But it sends the query and gets a response which it ignores. That seems buggy.
The query gets sent "on the wire" (loopback) to 127.0.0.1, so I wondered if perhaps node was saying "I sent the query to 0.0.0.0 but got a reply from 127.0.0.1 so I'm going to ignore it. I tried to figure that out but got lost in the source.
How often does it reproduce? Is there a required condition?
100% reproducible.
What is the expected behavior?
Having a nameserver in resolv.conf set to 0.0.0.0 would work the same as 127.0.0.1.
Since it sends the query, I would expect it to accept/use the response it gets back.
What do you see instead?
0.0.0.0 causes timeouts, while 127.0.0.1 works fine.
Additional information
No response
The text was updated successfully, but these errors were encountered:
tniessen
added
cares
Issues and PRs related to the c-ares dependency or the cares_wrap binding.
dns
Issues and PRs related to the dns subsystem.
labels
Aug 17, 2021
Hi. Why do you think 0.0.0.0 would work? It is not the address of any actual resource. But 127.0.0.1 is. Zeros have special meaning as 255s have. So I think it is not an issue but incorrect usage/config of the address.
In the old days (early 90s is when I think I picked it up) "nameserver 0.0.0.0" was the resolv.conf convention for "localhost". glibc's resolver (based on BIND) recognized it and did the right thing.
Objectively, I'd agree that it probably doesn't make sense, and I certainly wouldn't go out of my way to make it work. BUT, node does send a query and it does get a response, which is ignored or discarded for whatever reason. If it rejected the address or failed to query, I wouldn't complain, but the current behavior seems buggy.
Version
v14.17.5
Platform
Linux crux 5.10.59 #2 SMP Sun Aug 15 09:05:30 EDT 2021 i686 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
This code will eventually fail with a timeout, as if it didn't get any replies. However, the A query is sent to localhost and the local DNS server (BIND) replies immediately (as confirmed with both tcpdump and strace), every time it retries the query. However, it seems as if node is discarding the response for some reason.
Changing the DNS server to 127.0.0.1 (or any specific IP) works fine. Changing the nameserver line in /etc/resolv.conf and omitting the call to setServers() works exactly the same.
glibc is fine with "nameserver 0.0.0.0" in /etc/resolv.conf. I've never seen anything else fail like this, or care. (I understand that doesn't mean it's right!)
If node claimed 0.0.0.0 was invalid, or refused/failed to send the query, I would accept that as intended behavior. But it sends the query and gets a response which it ignores. That seems buggy.
The query gets sent "on the wire" (loopback) to 127.0.0.1, so I wondered if perhaps node was saying "I sent the query to 0.0.0.0 but got a reply from 127.0.0.1 so I'm going to ignore it. I tried to figure that out but got lost in the source.
How often does it reproduce? Is there a required condition?
100% reproducible.
What is the expected behavior?
Having a nameserver in resolv.conf set to 0.0.0.0 would work the same as 127.0.0.1.
Since it sends the query, I would expect it to accept/use the response it gets back.
What do you see instead?
0.0.0.0 causes timeouts, while 127.0.0.1 works fine.
Additional information
No response
The text was updated successfully, but these errors were encountered: