summaryrefslogtreecommitdiffstats
path: root/lib/resolv.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/resolv.rb')
-rw-r--r--lib/resolv.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/resolv.rb b/lib/resolv.rb
index 265a4b7f0..9a6574695 100644
--- a/lib/resolv.rb
+++ b/lib/resolv.rb
@@ -655,6 +655,7 @@ class Resolv
def initialize
super()
@sock = UDPSocket.new
+ @sock.do_not_reverse_lookup = true
@sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::F_SETFD
DNS.bind_random_port(@sock)
end
@@ -701,9 +702,10 @@ class Resolv
@port = port
is_ipv6 = host.index(':')
@sock = UDPSocket.new(is_ipv6 ? Socket::AF_INET6 : Socket::AF_INET)
+ @sock.do_not_reverse_lookup = true
+ @sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::F_SETFD
DNS.bind_random_port(@sock, is_ipv6)
@sock.connect(host, port)
- @sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::F_SETFD
end
def recv_reply