in reply to DNS Resolution4
I think you probably misread this example:
Note that $iaddr, not the return value of gethostbyaddr, is passed to inet_ntoa. What you want can be reduced to a single line:($port, $iaddr) = sockaddr_in(getpeername(Socket_Handle)); $peer_host = gethostbyaddr($iaddr, AF_INET); $peer_addr = inet_ntoa($iaddr);
hdp.(gethostbyaddr(gethostbyname($ipaddr), AF_INET))[0]
p.s. chomp $ipaddr or it'll continue to fail, but in a new and interesting way!
|
|---|