≡ Menu

How to use the Linux ping command?

The question was – How to use the Linux / Unix ping command to check whether a site is responding?

The ping command is available on all Linux / Unix based systems as well as on Windows.

The ping command sends ICMP Echo request packets to the server which then responds back with ICMP response packets. The ping command then calculates the round trip time and displays the results.

It is safe to assume that all operating systems will have ping server functionality built into the system. So if a server does not respond to a ping request, it is almost certain that it is down or there are network connection issues on your side.

Here are some ping command examples:

ping google.com
ping yahoo.com
ping 8.8.8.8
ping localhost
ping 127.0.0.1

You can send a ping request to a domain name or an IP address. Note that if you pass in a domain name and if the DNS resolution fails, ping will error out with a host not found error:

[root@server ~]# ping asdf7878hj.com
ping: unknown host asdf7878hj.com

Another useful command that I will cover in a later post is the traceroute command on Linux based systems (tracert on Windows).

Comments on this entry are closed.