Shell script to get IP addresses of machines on my LAN

I need a shell script, one that can find IP addresses of machines connected to my LAN, get the names of the computer associated with those addresses, then display them like so in a list: “Bob’s L33T Boxx: #.#.#.#” Something like the network scanner in Apple Remote Desktop is what I’m looking to recreate. Is there a way to do this, and is there a good Unixy forum someone could direct me to for further information? Thanks a lot!

If you have a LinkSys router (and possibly others) there is a DHCP page among those in its web interface that will reveal those names.

Note that scraping a router’s DHCP page will, obviously, only list machines that are using DHCP. Any manually configured machines probably won’t appear on such pages.

You’re right, and what’s worse on my LinkSys at least, it only lists those that have renewed since the last time you did something that required activation.

you need nmap if you dont have it go “fink install nmap” if you dont have fink get it.

quick and dirty but works exactly how you want it to

nmap -sP -n 192.168.1.* | cut -f 2 -d ' ' | grep '\.'