ECONNRESET (Whois::ConnectionError) - Error Trying to Query Whois in Ruby -
i'm writing simple program in ruby check if list of domains taken. cycles through list, , uses following function check.
require 'rubygems' require 'whois' def check_domain(domain) c = whois::client.new c.query("google.com").available? end
the program keeps erroring out (even when hardcode in google.com), , prints message below. given how simple program is, i've run out of ideas - suggestions?
/library/ruby/gems/1.8/gems/whois-2.0.2/lib/whois/server/adapters/base.rb:165:in `query_the_socket': errno::econnreset: connection reset peer (whois::connectionerror) /library/ruby/gems/1.8/gems/whois-2.0.2/lib/whois/server/adapters/verisign.rb:41:in `request' /library/ruby/gems/1.8/gems/whois-2.0.2/lib/whois/server/adapters/base.rb:113:in `query' /library/ruby/gems/1.8/gems/whois-2.0.2/lib/whois/server/adapters/base.rb:150:in `buffer_start' /library/ruby/gems/1.8/gems/whois-2.0.2/lib/whois/server/adapters/base.rb:112:in `query' /library/ruby/gems/1.8/gems/whois-2.0.2/lib/whois/client.rb:90:in `query' /system/library/frameworks/ruby.framework/versions/1.8/usr/lib/ruby/1.8/timeout.rb:62:in `timeout' /library/ruby/gems/1.8/gems/whois-2.0.2/lib/whois/client.rb:87:in `query' checker.rb:7:in `check_domain' checker.rb:14 checker.rb:11:in `each' checker.rb:11
the 2 possible explanations issue:
- you behind firewall/proxy , client can't reach server
- (more realistic) request being throttled. .com servers, such godaddy, used reset connection way protect against multiple queries. see this ticket. can solve problem limiting number of requests same server.
Comments
Post a Comment