win32/resolv.rb may add outdated nameservers
When using Ruby on Windows, the Resolv class may use outdated nameservers without notice.
This is due to the fact that win32/resolv.rb walks the Registry and adds nameservers from all interfaces, including the ones that have a link down status. Code:
reg.open('Interfaces') do |reg|
reg.each_key do |iface,|
reg.open(iface) do |regif|
[ 'NameServer', 'DhcpNameServer' ].each do |key|
ns = regif.read_s(key)
When interface 1 has 126.96.36.199 for DhcpNameServer but the interface is down, and interface 2 has 10.something for nameserver, then still 188.8.131.52 will be queried by Resolv.