refactor name_from_dns in hostname lookup backend
refactor name_from_dns in hostname lookup backend

loop over an address family / resource record mapping to avoid
repetitive code.

chardi/musl,chardi/musl,chardi/musl