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.
Updated by nobu (Nobuyoshi Nakada) about 8 years ago
- Has duplicate Bug #12604: Win32::Resolv.get_resolv_info returns unavailable DNS servers added
Updated by jeremyevans0 (Jeremy Evans) almost 5 years ago
- Status changed from Open to Closed
Actions
Like0
Like0Like0