Hi. I only recently noticed this issue had been filed in response to an issue we had in Puppet.
Sadly, the subject is a little misleading, which led to the ticket being closed, when the actual issue is quite real.
We have this problem because we use Net::HTTP
to make a request, which uses TCPSocket
, which in turn uses sock_addrinfo
down in the C code under Ruby 1.8.7 to resolve the name to an address. I have not actually dug into the implementation of that, but it certainly doesn't look to be using the Resolv
library.
Unfortunately, just loading resolv-replace
wouldn't be enough, either: that uses Resolv to do the lookup, which is great, but it uses the class method family Resolv.get*
to obtain the addresses. They, in turn, use Resolv::DefaultResolver
, which is created at load time for the resolv
code and never replaced - and neither is there a mechanism for us to replace that at runtime without hacking directly into code in that class and, obviously, breaking if a newer version of Ruby changed the structure.
It would, ultimately, be great if the C implementation could support platform things like res_init()
at the appropriate time, but even a fallback where we could use the Ruby level Resolv
library without having to rewrite it ourselves or hack into the internals would be OK...