X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/f38aa87edf153cf8f5f5c93a78fbf1424a8e62f2..9cb3f02c2333ed806c8614a3f4509bd1cf346ddb:/lib/whois/whois.rb diff --git a/lib/whois/whois.rb b/lib/whois/whois.rb index 88c735b..7cc6e9d 100755 --- a/lib/whois/whois.rb +++ b/lib/whois/whois.rb @@ -4,6 +4,8 @@ require 'socket' require 'resolv' require 'ipaddr' require 'yaml' +require 'timeout' + require File.dirname(__FILE__) + '/server/server' # Module for manage all Whois Class @@ -92,7 +94,11 @@ module Whois def search_host begin if @host_search - @host = Resolv.getname self.ip.to_s + begin + timeout(5) {@host = Resolv.getname self.ip.to_s} + rescue Timeout::Error + @host=nil + end else @host = nil end