diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb index b30f28cc7c..24187dc2ee 100644 --- a/lib/drb/drb.rb +++ b/lib/drb/drb.rb @@ -847,7 +847,11 @@ module DRb def self.getservername host = Socket::gethostname begin - Socket::gethostbyname(host)[0] + Socket::getaddrinfo(host, nil, + Socket::AF_UNSPEC, + Socket::SOCK_STREAM, + 0, + Socket::AI_PASSIVE)[0][3] rescue 'localhost' end