How to use ping on a Mac: pinging websites, domains, or IP addresses
Ping is an essential utility for network administrators, but it’s also pretty handy to check if websites are online, your internet connection is working, or if a network resource is available. Here’s how to use it the ping utility in Mac OS X from the command line:
- Launch the Terminal, found in the Utilities folder of Applications
- Type the following command:
- This will ping to yahoo.com repeatedly until you stop the ping command from running by hitting Control+C
- To send a specific number of packets to an address, use the -c flag like so:
ping -c 5 192.168.0.1
The ping command only works if the server you are pinging is online, and responds to ping requests. Most servers do if they’re online, except perhaps the most hardened networks who reject ping for security purposes.
I use ping constantly to make sure network servers are available, because it’s a lot faster to ping an IP than to try and connect to it through any number of protocols. It’s also a great way to test internet connections latency, which can be helpful for troubleshooting network issues with wi-fi or wired connections.
For users who do not feel comfortable with the command line, users can turn to the Network Utility app, which is bundled with every version of Mac OS X and provides a simple user friendly interface to ping, as well as a host of other helpful networking utilities.