By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,852 Members | 2,259 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,852 IT Pros & Developers. It's quick & easy.

How to get the OS type from the IPAddress ?

100+
P: 296
How to get the OS type from the IPAddress or Hostname ?
Apr 6 '10 #1
Share this Question
Share on Google+
2 Replies


Expert Mod 100+
P: 589
How to get the OS type from the IPAddress or Hostname ?
You can't.

If you want the OS of the system where the script is running, that's stored in the $^O var.

Example:
C:\>perl -e "print $^O"
MSWin32
Apr 6 '10 #2

numberwhun
Expert Mod 2.5K+
P: 3,503
IP Address and Hostname are OS independent. There is no way to really tell what OS they are linked/assigned to. To tell that, you would either have to be at the machine the IP is assigned to or, when it connects to your website, have a look at the HTTP headers as it is stored in there.

Regards,

Jeff
Apr 6 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.