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 | 84dd6a2c9078a70424f5b7a771f2c49b5d478ace (patch) | |
tree | fcca21d82a3ed4f45a4499d26a69f76d00b4e128 /lib/custodian | |
parent | 4027be405e40e9a625d87a431bd7c8cdf922877f (diff) |
Use getnameinfo rather than getaddrinfo
Diffstat (limited to 'lib/custodian')
-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 |