find local computers

Marty Landman MLandman at face2interface.com
Tue Mar 2 11:12:00 UTC 2004


At 08:48 PM 3/1/2004, Pete Nesbitt wrote:

>ping cannot resolve a name, it can resolve a name to IP prior to sending 
>the packet, but it really doesn't care about names.

So I can say ping -c1 penguin instead of ping -c1 192.168.0.160 if I 
already know the names of all my boxes on the lan. But what I want to do is 
have a way to find all those boxes, ip addr and host name. The host cmd 
seems fine for this, i.e. I've modified the script to run `host` for each 
ip adr found on the lan, though I haven't finished parsing it yet.

>You may want to look at 'ping -b'  so send a broadcast ping, then collect 
>the results.

I don't understand the man page, could you give an example please? I'd like 
to ping everything for

192.168.0. with netmask 255.255.255.0

This is what I'm doing with the script now in fact, only I realize it's 
probably the hard way. At least I learned a little bash and awk though.

>won't help the name resolution at all.

But doing a host for each pingable ip works fine tbh so I'm happy with that.

This script could actually be used to put together canonical hosts files, 
although it'd be lacking in hosts other than the server name for apache 
virtual hosts... hope I'm saying that right.

Marty Landman   Face 2 Interface Inc.   845-679-9387
FormATable  DB: http://face2interface.com/Products/FormATable.shtml
Make a Website: http://face2interface.com/Home/Demo.shtml
Free Formmailer: http://face2interface.com/Products/Formal.shtml  





More information about the redhat-list mailing list