To find out does the remote host or server is up or down, you can use one small command called ping
in Linux command line.
ping
to Check Remote Server Is UpPing sends small packets to the defined host and echoes the result. Let’s try it:
$ ping fullstack-tutorials.com
PING fullstack-tutorials.com (104.31.82.55) 56(84) bytes of data.
64 bytes from 104.31.82.55: icmp_seq=1 ttl=61 time=1.05 ms
64 bytes from 104.31.82.55: icmp_seq=2 ttl=61 time=1.47 ms
64 bytes from 104.31.82.55: icmp_seq=3 ttl=61 time=1.13 ms
64 bytes from 104.31.82.55: icmp_seq=4 ttl=61 time=1.12 ms
^C
--- fullstack-tutorials.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3542ms
rtt min/avg/max/mdev = 1.050/1.195/1.476/0.167 ms
In this example, the ping sent 4 packets to the server and got response each time. After the 4th packet the execution was terminated with ^C
(ctrl + c). As we can see, the server is up and running.
ping
to Check Remote Server Is DownLet’s use random IP address, which does not response to see how it would look if we could not get contact.
$ ping 100.100.100.100
PING 100.100.100.100 (100.100.100.100) 56(84) bytes of data.
^C
--- 100.100.100.100 ping statistics ---
12 packets transmitted, 0 received, 100% packet loss, time 11260ms
Here, the execution was terminated after a while since no response was received. Basically this means that the server is down.