That will ping all the addresses between 192.168.1.0 and 192.168.1.255 and give you a list of all the hosts it finds. Whether the hostnames are returned depends on whether you have reverse-DNS resolution correctly configured on your network.
sudo apt-get install nmap
nmap -sP 192.168.1.0/24
nmap is an incredibly powerful tool with a lot of scanning options. Hell, even Trinity uses it in the second Matrix film.
If there are Windows clients on the network, you can use the "nmblookup" utility that comes with Samba to get hostnames. "nmblookup -A 10.10.10.10" will return that host's "Netbios" name, the one that appears in a network search using Windows.