Backport #2614 ยป resolv-default-config-hash-initialization.patch
lib/resolv.rb | ||
---|---|---|
end
|
||
def Config.default_config_hash(filename="/etc/resolv.conf")
|
||
config_hash = {}
|
||
if File.exist? filename
|
||
config_hash = Config.parse_resolv_conf(filename)
|
||
else
|
||
if /mswin|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM
|
||
require 'win32/resolv'
|
||
search, nameserver = Win32::Resolv.get_resolv_info
|
||
config_hash = {}
|
||
config_hash[:nameserver] = nameserver if nameserver
|
||
config_hash[:search] = [search].flatten if search
|
||
end
|