summaryrefslogtreecommitdiff
path: root/lib/custodian
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2014-12-11 12:43:00 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2014-12-11 12:43:00 +0000
commiteebda5a0e4962ab27aa1fe73f7c369c30015969f (patch)
tree8706adfe0802ce7d4cb4f507a407b2f2aa8ad5fc /lib/custodian
parent438cd474003180db5207f25965a39a267f52cc11 (diff)
Use getnameinfo rather than getaddrinfo
Diffstat (limited to 'lib/custodian')
-rw-r--r--lib/custodian/util/dns.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/custodian/util/dns.rb b/lib/custodian/util/dns.rb
index e04361d..82a7e68 100644
--- a/lib/custodian/util/dns.rb
+++ b/lib/custodian/util/dns.rb
@@ -32,9 +32,7 @@ module Custodian
begin
timeout( period ) do
begin
- Socket.getaddrinfo(ip, 'echo').each do |a|
- resolved = a[2] if ( a )
- end
+ resolved = Socket.getnameinfo(Socket.sockaddr_in(80, ip) ).first
rescue SocketError
resolved = nil
end