I want an output like this:

IP Address:

This is what I have done:

        ping -c 1 $1 > /dev/null      
        [ $? -eq 0 ] && echo "IP Address": $i is online.  

for i in 192.168.1.{1..255}  
test $i & disown  

I added this line to collect the hostname, which failed. How could I get the hostname?

nmap -sU --script nbstat.nse -p137 192.168.11.*  
  • 2
    For the Nmap scan try – Nordlys Jeger Jan 25 at 18:56
  • 1
    Why not just use host, nslookup or dig? – Thomas Jan 26 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.