summaryrefslogtreecommitdiff
path: root/lib/resolv.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/resolv.rb')
-rw-r--r--lib/resolv.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/resolv.rb b/lib/resolv.rb
index 9a96c55931..f238439116 100644
--- a/lib/resolv.rb
+++ b/lib/resolv.rb
@@ -638,7 +638,13 @@ class Resolv
if !select_result
raise ResolvTimeout
end
- reply, from = recv_reply(select_result[0])
+ begin
+ reply, from = recv_reply(select_result[0])
+ rescue Errno::ECONNREFUSED
+ # No name server running on the server?
+ # Don't wait anymore.
+ raise ResolvTimeout
+ end
begin
msg = Message.decode(reply)
rescue DecodeError