diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2014-12-11 12:43:00 +0000 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2014-12-11 12:43:00 +0000 |
commit | eebda5a0e4962ab27aa1fe73f7c369c30015969f (patch) | |
tree | 8706adfe0802ce7d4cb4f507a407b2f2aa8ad5fc | |
parent | 438cd474003180db5207f25965a39a267f52cc11 (diff) |
Use getnameinfo rather than getaddrinfo
-rw-r--r-- | lib/custodian/util/dns.rb | 4 |
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 |