using getaddrinfo to populate ipaddress of host