Actions
Bug #12494
closedwin32/resolv.rb may add outdated nameservers
Description
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|
begin
[ 'NameServer', 'DhcpNameServer' ].each do |key|
ns = regif.read_s(key)
unless ns.empty?
nameserver.concat(ns.split(/[,\s]\s*/))
When interface 1 has 8.8.8.8 for DhcpNameServer but the interface is down, and interface 2 has 10.something for nameserver, then still 8.8.8.8 will be queried by Resolv.
Actions
Like0
Like0Like0