# File lib/ftw/dns/dns.rb, line 12 def resolve(hostname) official, aliases, family, *addresses = Socket.gethostbyname(hostname) # We ignore family, here. Ruby will return v6 *and* v4 addresses in # the same gethostbyname() call. It is confusing. # # Let's just rely entirely on the length of the address string. return addresses.collect do |address| if address.length == 16 unpack_v6(address) else unpack_v4(address) end end end