powerhouse has asked for the wisdom of the Perl Monks concerning the following question:

Ok, I used the super search and searched for various variations of remote host, isp and dns... and I could not find it again... I had found on here one time how to get a visitors Host information, like the ISP:

12.12.12.12-host1.cox.ok.whateverelse.nonya

from Perl, using the IP address.

I cannot find it again and I cannot find the program I wrote a long time ago that I used it in.

I cannot use remote_addr because this is off a load balancer, so I have to use the HTTP_X_FORWARDED_FOR out of the %ENV to get the visitors real IP address.

Can you tell me how I can do the reverse look on the IP to get the ISP host w/ Ip string?

thx,
Richard

Replies are listed 'Best First'.
Re: Remote Host and DNS
by samtregar (Abbot) on Oct 25, 2007 at 00:27 UTC
    You're looking for gethostbyaddr. Example from the docs:

    use Socket; $iaddr = inet_aton("216.109.112.135"); $name = gethostbyaddr($iaddr, AF_INET);

    -sam

Re: Remote Host and DNS
by ikegami (Patriarch) on Oct 25, 2007 at 00:29 UTC

    gethostbyaddr

    Update: Oops, beaten to the punch and typed gethostbyname when I meant gethostbyaddr. Fixed.

Re: Remote Host and DNS
by lorn (Monk) on Oct 25, 2007 at 15:21 UTC