method
new
new(host, port=Port)
public
Hide source
# File lib/resolv.rb, line 797 def initialize(host, port=Port) super() @host = host @port = port is_ipv6 = host.index(':') sock = UDPSocket.new(is_ipv6 ? Socket::AF_INET6 : Socket::AF_INET) @socks = [sock] sock.do_not_reverse_lookup = true DNS.bind_random_port(sock, is_ipv6 ? "::" : "0.0.0.0") sock.connect(host, port) end