lib/wmap/utils/utils.rb
# Perform the DNS query on a hostname over the Internet. Return the resolved IP(s) in an array
Perform the DNS query on a hostname over the Internet. Return the resolved IP(s) in an array
Perform the DNS query on a hostname over the Internet . Return the resolved IP ( s ) in an array
def host_2_ips (hostname)
		begin
			ips=Array.new
			if is_ip?(hostname)
				ips.push(hostname)
				return ips
			else
				ips = Resolv.getaddresses(hostname)
				if (ips.empty?) then
					puts "Failed to resolve #{hostname}" if @verbose
					return nil
				else
					return ips
				end
			end
		rescue => ee
			puts "Exception on method host_2_ips for host #{hostname}: #{ee}" if @verbose
			return nil
		end
	end
def host_2_ips ( hostname ) begin ips = Array . new if is_ip? ( hostname ) ips . push ( hostname ) return ips else ips = Resolv . getaddresses ( hostname ) if ( ips . empty? ) then puts "Failed to resolve #{hostname}" if @verbose return nil else return ips end end rescue => ee puts "Exception on method host_2_ips for host #{hostname}: #{ee}" if @verbose return nil end end
Perform the DNS query on a hostname over the Internet.
Perform the DNS query on a hostname over the Internet .
hostname
<not_specific>