improved hostname/ip resolution