list hosts

hi to all!

Is there a way to list all hosts of your lan?
any help is welcome!
I tried nmap and it keeps returning command not found..
any other way to do it?
nmap would need to be installed of course.

Unless there's something that maintains a list of hosts (like a directory server) you have to check what's there now. And that means trying to talk to them over the LAN (that's what nmap does well).

You could write a script that generated the address for your subnet and ping'd them. You'd need the network (from ip address and subnet mask) to generate addresses. And they'd all need to reply to pings if you're to ping them. This link does that for network 192.168.1 (mask 255.255.255.0):
http://www.cyberciti.biz/faq/mapping-lan-with-linux-unix-ping-command/
Last edited on
writing a script would be the best but the thing is that this script does
the listing of ip addresses,but I want a list of the hostnames..
Is there a way to change this script?
You can reverse lookup the addresses.
Last edited on
Topic archived. No new replies allowed.