develooper Front page | perl.beginners | Postings from April 2002

Name resolution from IP

Thread Next
John Edwards
April 30, 2002 06:39
Name resolution from IP
Message ID:
How can I resolve a machine name from an IP address? The machine that the
script is running on is NT4.

I've tried this (with use Socket qw(:DEFAULT :crlf); at the top of the

$machine_name = gethostbyaddr(inet_aton($userIP), AF_INET) or die "Can't
resolve $userIP: $!\n"

It works on the LAN, but not across a router to the remainder of our WAN.
Any ideas?

John Edwards
IT Support
Runecraft Leeds

0113  2206317
07961 356186

Disclaimer: These are my opinions and probably not those of my employer,
since I developed them long before I came to work for my current employer.

This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About