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
I suspected the same. But I replicated c-ares system calls and logic, and did not reproduce the reversal.
On my system, those DNS servers are returned (from GetAdaptersAddresses) in correct order, on the same interface, have the same metric (0, from GetBestRoute2), and qsort does not switch their order.
Version
v16.14.0
Platform
Microsoft Windows NT 10.0.19044.0 x64
Subsystem
dns
What steps will reproduce the bug?
My Primary DNS server configures for
127.0.0.1
, a local instance of SmartDns. My secondary DNS server is my ISP's.However, Node resolves using the secondary DNS server, not the primary:
I can tell because of the short TTLs, whereas my SmartDns server is configured with a minimum TTL of 2400. Thus:
And as confirmation:
How often does it reproduce? Is there a required condition?
Always sorts local addresses after remote addresses. If both Primary and Secondary are remote, then re-ordering does not happen.
What is the expected behavior?
I'd expect
dns.getServers()
to return[ 'primary', 'secondary' ]
, and for name resolution to prefer the Primary DNS server.What do you see instead?
dns.getServers()
reverse the primary and secondary DNS servers, and resolution prefers the secondary server.Additional information
The text was updated successfully, but these errors were encountered: