summaryrefslogtreecommitdiff
path: root/lib/custodian/util/dns.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/custodian/util/dns.rb')
-rw-r--r--lib/custodian/util/dns.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/custodian/util/dns.rb b/lib/custodian/util/dns.rb
index 2a0c705..b93fef5 100644
--- a/lib/custodian/util/dns.rb
+++ b/lib/custodian/util/dns.rb
@@ -20,7 +20,7 @@ module Custodian
#
# Return the reverse DNS for the specified IP address, nil on failure.
#
- def DNS.ip_to_hostname( ip )
+ def DNS.ip_to_hostname(ip)
resolved = nil
#
@@ -30,9 +30,9 @@ module Custodian
period = settings.timeout
begin
- timeout( period ) do
+ timeout(period) do
begin
- resolved = Socket.getnameinfo(Socket.sockaddr_in(80, ip) ).first
+ resolved = Socket.getnameinfo(Socket.sockaddr_in(80, ip)).first
rescue SocketError
resolved = nil
end
@@ -47,7 +47,7 @@ module Custodian
#
# Convert a hostname to an IP address, return nil on failure.
#
- def DNS.hostname_to_ip( hostname )
+ def DNS.hostname_to_ip(hostname)
resolved = nil
@@ -58,7 +58,7 @@ module Custodian
period = settings.timeout
begin
- timeout( period ) do
+ timeout(period) do
begin
Socket.getaddrinfo(hostname, 'echo').each do |a|
resolved = a[3] if a