change gethostbyaddr() to getaddrinfo()