The quickest, most commonly
used, and, frequently most helpful TCP/IP troubleshooting tool is the
command-line tool ping. Use
ping to find out whether the resource or server
you're trying to connect to on your network or the
Internet is active, and to see if there are any problems with the
hops along the way to that resource or server.
ping sends
Internet Control Message Protocol (ICMP)
Echo Request messages to the destination you're
checking on, receives responses in return, and reports to you
information about the
connection path between you and the destination and how quickly the
packets made their trip. For example, if you are having trouble
getting
email from a server, your first
step in troubleshooting should be to ping the server to see whether
the server is live, and to see how responsive it is. To use
ping, first open a command prompt:
Opening a Command Prompt in Windows
Then type:
ping target
where target is either a hostname or an IP address—for example, pop3.catalog.com, zdnet.com, or 209.124.112.1
In response, you'll get information in this format:
If the host isn't active, instead of getting this report, you'll get the message "Request timed out."
If you enter a hostname, ping reports back with its IP address and then gives details about its four attempts to contact the host, a measurement of how long (in milliseconds) the packet took to make the round trip between your PC and the host, the Time To Live (TTL) information about each packet, and a summary of its findings.
The TTL field can tell you how many hops the packets took to get from your PC to its destination. TTL initially specified the amount of time a packet could live, in seconds, before it expires, as a way to make sure that packets didn't simply bounce around the Internet forever and create traffic jams. However, it has been reinterpreted to mean the maximum number of hops that a packet will be allowed to take before its destination. The default number is 255. Each time a packet takes another hop, its TTL is reduced by one. The TTL number that ping reports is the packet's final TTL when it reaches its destination. To find out the number of hops a packet takes, subtract its initial TTL (by default 255) from the TTL reported by ping. In our example, the packets took 13 hops to get to their destination.
You can use ping with switches, like so:
ping -a -l 45 www.litecloudhosting.com
This command changes the packet size sent from its default size of 32 bytes to 45 bites, and resolves the IP address to a hostname—in other words, it lists the IP address's hostname.
ping has a wide variety of useful switches that you can use for all kinds of troubleshooting. You use the basic ping command to check whether an Internet or network resource is live and to see if there are any delays in reaching it. But, as the table below shows, you can use ping and its switches for many other purposes as well—for example, to find out the IP address of a hostname and vice versa.