How to use ping on a Mac: pinging websites, domains, or IP addresses

Apr 28, 2010 - 4 Comments

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:
  • ping yahoo.com

  • 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.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: Paul Horowitz in Command Line, Mac OS X, Tips & Tricks

4 Comments

» Comments RSS Feed

  1. inket says:

    Additional Information:
    “Network Utility.app” provides a GUI version for Ping and other administration commands. (Traceroute, Lookup, whois etc.)

  2. Bronzit says:

    inket: What he said = easiest way.

  3. […] Note: for whatever reason, when you are setting the IP address manually via the command line the Mac OS X Network Preferences doesn’t necessarily catch up to the changes. Do not be surprised if the Network preference pane is telling you that you “Airport does not have an IP address and cannot connect to the Internet.” when in fact, you do have one and you are online. You can verify that you are connected to the LAN or internet by using the ping command. […]

  4. Brock says:

    Network Utility resolved my issue!

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates