Created
March 13, 2018 14:01
-
-
Save nbarrientos/a3c6b49c0c30c30bdf056ac8dbb811fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
puts resolver.getaddress('foo.example.org') | |
rescue Exception => e | |
puts e.class | |
puts e.message | |
end | |
# DNS server not available | |
$ ruby foo.rb | |
Resolv::ResolvError | |
DNS result has no information for foo.example.org | |
# DNS server available but no record for foo.example.org | |
$ ruby foo.rb | |
Resolv::ResolvError | |
DNS result has no information for foo.example.org |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment