Actions
Feature #18151
closedIncorrect Resolv result when DNS server is unreachable
Status:
Closed
Assignee:
-
Target version:
-
Description
The Resolv class has an incorrect behavior when the DNS server can't be reached.
The attached script highlight the issue which - depending on your needs in resolving host names - could be really problematic.
Here's the output of the script:
$ ruby test_resolv.rb
Resolution of an existing domain name -> OK
["142.250.184.68", "2a00:1450:4002:806::2004"]
Resolution of a non existing domain name -> OK
[]
Attempt of resolving a domain name with an incorrect/unreachable DNS server -> KO
[]
-> Expecting: ResolvError
Obviously the result for both NXDOMAIN and failure to reach the DNS server is identical, hence it make impossible to handle errors programmatically.
A proper result when the DNS server is not reachable would be to get a ResolvError exception fired.
Files
Actions
Like0
Like0Like0