The only issue is that Resolv::Hosts needs either an address or a hostname in order to work, so this is basically looking up each address, and then using Resolv::Hosts to look up each host so that you don't have to do any more string munging.