Change gethostbyname calls to getaddrinfo for dual stack support

ipv6 enablement