ping question

Tony Arnold tony.arnold at manchester.ac.uk
Wed Nov 22 15:09:39 UTC 2006



Claudio Clemens wrote:
> Hi,
> 
> 2006-11-21, 23:14 +0500, Waqas Toor:
>> Hi Linuxers,
>>
>> may be its a simple question to post here,
>> what is the difference between ping -b and arp ... both are for
>> broadcasting over the network

well, they use the broadcast mechanism, but that is not their purpose.
Ping is used to see if an interface is alive by sneding it an ICMP echo
request which interfaces tend to respond with (unless configured not
to). I presume the -b option means you can send the request out on a
broadcast address and get responses back from several machines at once.

arp (address reolution protocol) is used to determine the MAC address of
an IP address. It broadcasts a message that says 'who is using this IP
address?' and the machine with ay IP address reeplies.


>> 2nd question is
>> how can i retrieve the hostnames by broadcastring over the network
>> my broadcast address is 192.168.1.225
>> ???
>> i need results in the form of
>> hostname1
>> hostname2
>> hostname3
>> so on
>> any suggestions
> 
> host <ip> should give you a name for the ip.

This will do a DNS lookup and will only work on a private address range
if you have a local DNS server or the addresses are in the local
/etc/hosts file. Samba may be able to do this, as I think Samba servers
tend to advertise themselves. Non Samba machine do not, AFAIK.

Regards,
Tony.
-- 
Tony Arnold, IT Security Coordinator, University of Manchester,
IT Services Division, Kilburn Building, Oxford Road, Manchester M13 9PL.
T: +44 (0)161 275 6093, F: +44 (0)870 136 1004, M: +44 (0)773 330 0039
E: tony.arnold at manchester.ac.uk, H: http://www.man.ac.uk/Tony.Arnold




More information about the ubuntu-users mailing list