Project

General

Profile

Bug #12494

win32/resolv.rb may add outdated nameservers

Added by valentyn (Valentijn Sessink) over 3 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:76041]

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.


Related issues

Has duplicate Ruby master - Bug #12604: Win32::Resolv.get_resolv_info returns unavailable DNS serversClosedActions

History

#1

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • Has duplicate Bug #12604: Win32::Resolv.get_resolv_info returns unavailable DNS servers added
#2

Updated by jeremyevans0 (Jeremy Evans) 4 months ago

  • Status changed from Open to Closed

Also available in: Atom PDF