Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I get a list of machine IP's on the network?

Status
Not open for further replies.

timfoster

Programmer
Dec 19, 2002
110
0
0
GB
I need to get a list of the IP addresses, and ideally the names, of all the machines on my network from asp.

What I'm ultimately trying to do is play media on any machine, or group of machines, on the network. The media files will be stored centrally, but I want to be able to create 'zones' and play media out to that zone from any of the machines on the network.

If I (or someone here) can figure out how I can get the list of machine IP's, I can play the media.

Thanks.
 
Depends how you want to get the IPs.

1. Statically, just go and look at each machine and do an ipconfig (or ifconfig if on *nix) and write all the IP's down, then store them in an xml file or in a db on your ASP server.

2. Dynamically via lookups,
a) If they are dhcp addresses and create a dns entry for the hostname when it's registered, then you can use the hostnames and do an nslookup via vbscript using a shell.
b) If if they are dhcp addresses not in dns then it depends on your dhcp server, and your access to it - probably difficult.

3. Dynamically via bruteforce, just scan your subnet (e.g. a simple ping check of each host ip in the range you want) and then do a nslookup against each IP that responds to get the hostname

Here's an example of pinging from Classic ASP:
you can use the same technique of using the Windows Script Host Shell to run the nslookup command and parse the hostname from it.

I think you can query dhcp with "netsh dhcp server \\yourdhcpserver show all" or something like that

=======================================
LessThanDot - The IT Community of the 21st Century

A smile is worth a thousand kind words. So smile, it's easy! :)
 
Cool. Thanks. That was exactly what I need. Brute force I think!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top