Ping is a fundamental command-line tool used to test network connectivity at multiple levels, from the local interface to external servers. This content covers how to use ping systematically to isolate network issues and introduces key options like continuous pinging.
Using Ping to Troubleshoot
To use ping, I'm going to do it in the command window. I'm going to bring up a command prompt by clicking the start menu and then typing in cmd and hitting enter. That brings up a command window.
I'm going to type ping and then either the host name or the IP address that I'm trying to get to. In this case, I'm going to start out with the loopback address. When I hit this, it is getting a response, and it's a very quick response — I hope so, because it's pinging itself in this case. This is essentially checking the interface and making sure it's up and it's got the basic information that it needs to be up and running. We see that yes, in fact, this interface is up, and it is connected to something, because we're getting a response back from the interface. So the interface is live.
The next thing that I can do is ping the default gateway, or some other machine on the network — it doesn't really matter. So I'm going to type in 192.168.42.1, which is my default gateway for this machine.
You'll see that there's not much of a difference. It's two milliseconds this time, so a little more time to get a response back from the default gateway.
What this is testing is: do I have an IP address on this? Do I have a subnet mask? Do I have connectivity to other local area resources? And is my default gateway even up? I see that the default gateway is up. It doesn't necessarily need a default gateway set up on this machine in order to ping the default gateway, because it's still a local address.
Next, what I can do is ping something externally. I could test this if I knew what the IP address was of the internet service provider. A lot of the businesses that I'll work with, I do know that external IP address, and I can ping that to see if there's connectivity there.
In this case right here, I don't know what the internet service provider IP address is on the other side, but I'm going to ping something even further out, which is going to be 8.8.8.8, which is a DNS server that's out there. So I'm going to ping this, and I'm going to get a response back that lets me know I have an IP address set up on my interface, I have a default gateway set up, I have the correct subnet mask set up in there, and I can get out to the outside world. So my internet service provider is up and running, and that server that I'm pinging out there is up and running. Everything is working from that perspective; information is flowing.
When I ping something like that, it's testing one additional aspect as well. All the things that I just mentioned, but it also has done some name resolution. So now I know that DNS is set up correctly here, I have a DNS set up on this local machine, and it's resolving, probably to some sort of server that is set up and seems to be functioning as well.
So there are some steps there: I can ping these different levels to see if I have certain issues, depending on what I am pinging out there.
There are also a lot of options that you can include with ping. If I go here and type in "ping command" on my Google Chrome browser, I'm going to ask what different options there are. You can see that I can go into any of these documents and it will list out what my different options are and what they do.
I have things like: I can set the time to live, I can set the size so it's a different size, and I can say how many I want to be sent out — the default is four. So I can change different aspects to this.
One of the things that I often use when I'm troubleshooting is this /t, and it's a continuous ping, so it'll send a continuous ping until I stop it. What I can do is choose a server, do a /t here, and just let it run. I'll do this if I'm maybe resetting an interface or redoing something and I want to see if the connectivity goes down, or maybe I'm already down and I do this continuous ping as I'm trying different things to see if it comes up. So this is one that I'll use often.
I haven't used some of the other options as much. I can see how they could come in handy now and then, but this is the main one that I've found has been really helpful.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →