ruby-dns / net-dns

Net::DNS is a DNS library written in Ruby.
http://net-dns.rubyforge.org
Other
165 stars 43 forks source link

Error when IPv6 is not supported by the underlying OS. #49

Open paulosalem opened 11 years ago

paulosalem commented 11 years ago

I got this Exception message when trying to run a net-dns query on EngineYard:

Address family not supported by protocol - socket(2) - udp.

By reading the logs, I found that the error is at:

net/dns/resolver.rb:1198:in `query_udp'

Which currently is:

socket6 = UDPSocket.new(Socket::AF_INET6)

I checked at EngineYard, and apparently they do not support IP v6 yet. So that explains the error. Proper handling of this case can be added to fix the issue.

rosscooperman commented 11 years ago

I created a fork w/ a commit that fixes this here:

https://github.com/rosscooperman/net-dns/commit/bbe1b4470f2c91dc808b4e61a1264bee340e72ee

Could a committed let me know what needs to be done (test wise) to get this pulled in?