Use getaddrinfo() instead of resolve_host(). Patch by Martin Storsjö