How To: Ping in Mac OS X Terminal

How To: Ping in Mac OS X Terminal

Ping is a quick test of network connectivity between one host and another. Use ping to troubleshoot basic network connectivity issues. Ping allows you to send a network packet to another device in an attempt to solicit a response to confirm if a device is online or not. Use Terminal in Mac OS X to ping any network device, website, or anything with a network address on the Internet or your local area network. 

 

Ping an Internet Address in Mac OS Terminal





 

Note: You should never expect to ping a network device address and assume it will reply back. Web servers, computers, and network devices sometimes block ping as a security measure. So, just because a network device does not respond to a ping never means the host is offline. In practical cases, pinging local devices on your network will almost always respond to ping unless your using a firewall.

 

1. Open Terminal (Applications -> Utilities -> Terminal)

2. Type the following command

 ping google.com

 

3. This will ping Google based on your Mac DNS servers. In this example. Ping responds back after resolving google.com to 216.58.192.174. Look like Google is online!

Mac terminal ping google

 

4. Type ctrl + z to kill the ping command in Terminal.

 

Ping a Local Network Address in Mac OS Terminal

 

If you are trying to troubleshoot network connectivity with a device on your local network, ping it. In this example, we ping the IP Address of our printer from our Mac to ensure it responds back and confirm network connectivity.

 

1. Open Terminal (Applications -> Utilities -> Terminal)

2. Type the following command (This is the IP Address of our printer)

 ping 192.168.1.129

 

3. The printer responds back pictured below. We can safely assume our printer is online on our local network!

MAc terminal ping local printer terminal

 

4. Type ctrl + z to kill the ping command in Terminal.

* Please use the comment form below. Comments are moderated.*



Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Wednesday, 04 December 2024