How to use the PING command to solve network issues

The following video on how to use the PING command to diagnose and solve network issues is a great recourse for anyone who wants to work as a network administrator. Since most admins don’t speak English as their native language these tutorials by PowerCert are very usual because they contain important IT phrases and terminology. The three abbreviations used in this tutorial are:

  1. DNS – Domain Name System
  2. LED – Light Emitting Diode
  3. IP – Internet Protocol

Here is the transcript of the video:

The PING Command

Hello everyone, in this video we’re going to talk about one of the most widely used utilities that’s used in networking and I’m talking about the ping command.

Now, the ping command is a simple tool that you can use to troubleshoot networking issues such as network connectivity so you can use it to test if you’re connected to a local area network or if you’re even connected to the Internet you can also use it to test if your network interface card is working correctly and it’s also used to test DNS issues such as name resolution.

So for example let’s go ahead and ping an IP address of a host.

Now this host could be any network device such as a computer, server, router or printer whether it’s on your local area network or over the Internet but in this example we’re going to ping a server in our local area network.

So we would open up a command prompt and then we would type the word ping along with the IP address of the server and then press ‘enter’.

Then the ping utility will send out four data packets to the IP address of the server. Then our computer will wait for a response. Then the server will send the data packets back to us as a reply and these replies are called ‘echo reply requests’ and these replies inform you about what’s happening with the server we pinged. So for example if we received a reply, then that is a good sign. Then that means that there is network connectivity between us and the server whether that server is on your local area network or over the Internet.

So, four packets were sent and then four packets were received but if we ping the same server and this time if we didn’t get a reply then that means that the server didn’t reply back and it could mean that there is no network connectivity between our computer and the server now this could be for several different reasons.

So, for example when we ping the server and if we get a message back that says ‘request timed out’, then that could mean that the server is powered down or it could also mean that the server is up and running but it’s using a firewall that’s blocking all ping requests.

How, what happens when you try and ping a host and not all of the data packets reply back to you?

So, for example when you ping a host, your computer sends out four data packets but sometimes you may only get one two or three packets back instead of the four that you sent out.

Well, this is called ‘packet loss’ and packet loss can occur for several reasons. It could mean that there’s network congestion if there is a lot of traffic on a network and the network can’t handle all that extra traffic. Then data packets will get dropped.

Or it could also happen because of faulty hardware such as bad cables or bad wiring or it could be a bad network card or bad connections. Or it could be a bad modem which is exactly what happened to me in my case a few years ago.

I was constantly lagging on just about everything I did on the Internet so I did a continuous ping test and I was dropping at least one third of my packets failed consistently so I determined that it had to be my modem. So I had it replaced and it solved the problem.

Or in another scenario if we wanted to ping a remote server on the Internet and if we got a message that says ‘destination host unreachable’ then that means that a route to the destination cannot be found so it could mean that a router doesn’t have any information on how to route data to the destination. Or it could also mean that the remote server is down or disconnected from the network. Or it could also mean that your computer is not connected to a network.

So let’s use the ping command in a typical scenario. So, suppose someone tells me that they don’t have an internet connection because they can’t access any web pages with their computer which is a pretty common issue. So, the first thing I do is that I would sit at their computer and use the pin utility to see if in fact they are not connected to the Internet.

So, even before I check their modem or router or any cable connections, the first thing I do is do a simple ping test. So, I would open up a command prompt and see if I can ping a website such as yahoo dot com.

Now, notice in this method I’m actually pinging the domain name yahoo dot com and not its IP address because by doing it this way I’m also testing name resolution issues related to DNS and also besides that I don’t have Yahoo’s IP address memorized.

So, by pinging yahoo dot com and if the ping is successful then I know that we are connected to the internet because when I got a successful reply from yahoo dot com then I automatically know that all of my hardware such as my cables the network card the router and the modem are all working correctly including my internet service provider.

So, now I know that the reason that this computer can’t bring up web pages is related to software and not hardware. So the problem is most likely with their internet browser or it’s a firewall issue. So by doing a ping test first it saved me a lot of time because I bypassed the hassle of looking around for the modem over the router or looking at LEDs or checking the cables or looking behind the computer to see if a network cable is plugged into my network card. I simply sat down and did a simple ping test.

So, really the only time you need to check your hardware is if the ping was not successful.

However, even before you start checking hardware, you can also use the ping command to check other things such as testing if your network interface card is working correctly and this is called a loopback test’. A loopback test will send out signals back to your computer for testing purposes.

So, at a command prompt I would type ‘ping’ and then the loopback IP address which is 127 0.01 or you can simply type ‘ping localhost’ which does the same thing and if the ping was successful then you can be assured that your network card is working properly. But if the loopback test failed, then there’s a problem with your network card.

Now, the ping command can also be used to test DNS name resolution issues and if you’re not familiar with what DNS does please watch my DNS video on my YouTube channel but in a nutshell DNS is what resolves domain names to IP addresses.

So, as you recall earlier I did a ping test by pinging the domain name yahoo dot com instead of its IP address and as I said before if the ping was successful then that means that all of my hardware is
working correctly but in addition it also verifies that DNS is working correctly.

So, as you can see DNS successfully resolved and found the IP address for yahoo dot com but if we pinged yahoo dot com and we got a message that says ‘ping request could not find host yahoo dot com please check the name and try again’, then this could be a DNS issue because our computer could not resolve the domain name to an IP address.

So, the next thing to do is to try and ping the IP address instead and that’s if you already knew what the IP address was already or if you don’t like most of us don’t already you can type in an easy IP address to remember such as Google’s DNS IP address which is 8.8.8.8 and if the ping was successful this time, then this confirms it’s a DNS issue because the computer can ping IP addresses but it can’t ping domain names.

So, to solve this you can try a few things you can try flushing your DNS by typing ‘IP config /s’ at a command prompt or you may want to check your DNS settings on your network card configuration and it could also be a problem with the DNS servers themselves or it could be a problem with your internet service provider. And finally the ping command can also be combined with other sub commands called ‘switches’ and switches are used to alter the parameters of the ping utility and you can view a full list of these switches by typing ping forward slash and then a question mark.

3 Likes