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

Name resolution from IP

Thread Next
From:
John Edwards
Date:
April 30, 2002 06:39
Subject:
Name resolution from IP
Message ID:
2FB59B145095D511A7C90050BAC349F31735D9@MAIL
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
script)

$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
www.runecraft.co.uk

--
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.





--------------------------Confidentiality--------------------------.
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About