From: ga rg Date: 2008-08-06T20:59:38+09:00 Subject: Re: Reverse DNS lookup? Thank you very much. That works perfectly :). Any reason why getnamebyaddr didn't work because rubydocs seems to suggest that it should. Heesob Park wrote: > Hi, > > 2008/8/6 ga rg : >> TwoOctets = "10.26" >> >> append_to_file("unknown - #{current_ip} - #{mac_addr}") >> end >> end >> >> If I do `nslookup 10.26.6.12` then I get the correct reverse DNS so >> that shows that my machine is seeing the dns server. >> >> I have tried Socket.gethostbyname, gethostbyaddr, but it doesn't work : >> ( >> >> Any guidance will be much appreciated. Thanks! >> > Try getaddrinfo like this: > > s = Socket.getaddrinfo('10.26.6.12',nil) > hostname = s[0][2] > > > Regards, > > Park Heesob -- Posted via http://www.ruby-forum.com/.