Pinging is a diagnostic tool to establish whether a computer or network device is responding, you can use the ping command on either a LAN or WAN.
When you ping another computer or device it basically sends a packet of data to the destination ip address or DNS name and see how quick the packet is returned. obviously if the packet is not returned the computer or device is not online.
LAN = Local Area Network (ie a office or home network)
WAN = Wide Area Network (ie, the internet)
DNS = Domain Naming Service (ie,
www.google.co.uk is the DNS address which would resolve to the IP address 216.239.39.147)
From an IP address you can find out the general location of the server that issues the IP but not the location of the computer that is using the IP. and yes you can ping an IP address to find out if someones online. although this is not a reliable method of finding out if your mates are online as IP addresses assigned by ISP's often change. (DNS names generally don't).
To find out if google.co.uk is online you would open a command prompt window and type "ping 216.239.39.147" if the servers online you will get a reply, (well four reply's) if it isn't the ping will either timeout or you will receive an error message along the lines of "destination not accessible"
quite boring really.