From: Stephan Maka Date: 2006-05-06T11:56:33+09:00 Subject: Resolv::DNS and IPv6 nameservers --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello folks, UDPSocket requires address family given on initialization, so it's not possible to create an UDPSocket and *then* decide, to which hosts to send packets to. That's a problem for Ruby's resolver if you've got AF_INET6 nameservers in your /etc/resolv.conf. The following very dirty hack chooses AF_INET6 for UDPSocket, if the nameserver's address contains colons (:). --- /usr/local/lib/ruby/1.8/resolv.rb Mon Feb 7 16:24:09 2005 +++ resolv2.rb Sun Apr 23 20:53:17 2006 @@ -621,7 +621,7 @@ super() @host = host @port = port - @sock = UDPSocket.new + @sock = UDPSocket.new(host.index(':') ? Socket::AF_INET6 : Socket::AF_INET) @sock.connect(host, port) @sock.fcntl(Fcntl::F_SETFD, 1) if defined? Fcntl::F_SETFD @id = -1 Any suggestions? Stephan. --MGYHOYXEY6WxJCY8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (FreeBSD) iD8DBQFEXBB0uKMfCHUX8x0RAiH0AJ9BxH9Be/Wr/j3urzE3mAn7ascP7ACgmw3W FZvtr0DsNztMLrv2qSh4FQQ= =VhQY -----END PGP SIGNATURE----- --MGYHOYXEY6WxJCY8--