[email protected]Support 24/7 · Billing 09:00 – 00:00LinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedJune 13, 2023

How to use Ping command.

How To Use Ping Command.

In this article, wee will explain how to use ping command.

ping is part of the iputils (or iputils-ping) package, which is pre-installed on nearly all Linux distributions. It is also available on Windows, macOS, and FreeBSD.

 

How to Use the Ping Command

The syntax for the ping command is as follows:

ping [OPTIONS] DESTINATION

To better illustrate, how the ping command works let’s ping nexonhost.com:

ping nexonhost.com

The output will look something like this:

PING nexonhost.com (89.45.12.91) 56(84) bytes of data.
64 bytes from 89.45.12.91 (89.45.12.91): icmp_seq=1 ttl=63 time=0.527 ms
64 bytes from 89.45.12.91 (89.45.12.91): icmp_seq=2 ttl=63 time=0.637 ms
64 bytes from 89.45.12.91 (89.45.12.91): icmp_seq=3 ttl=63 time=0.577 ms
64 bytes from 89.45.12.91 (89.45.12.91): icmp_seq=4 ttl=63 time=0.573 ms
64 bytes from 89.45.12.91 (89.45.12.91): icmp_seq=5 ttl=63 time=0.610 ms
^C
--- nexonhost.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4001ms
rtt min/avg/max/mdev = 0.527/0.584/0.637/0.048 ms

 

Specify the Number of Packets

As already mentioned, by default, ping will continue to send ICMP packages until it receives an interrupt signal. To specify the number of Echo Request packages to be sent after which ping will exit, use the -c option followed by the number of the packages:

ping -c 1 DESTINATION

For example, to ping linuxize.com only one time you would use:

ping -c 1 nexonhost.com

 

Specify the Source Interface

The default behavior of the ping command is to send ICMP packages via the default route. If you have multiple interfaces on your machine you can specify the source interface with the -I option:

ping -I INTERFACE_NAME DESTINATION

The following command will ping linuxize.com using em2 as a source interface:

ping -I em2 nexonhost.com

 

Specify the Internet Protocol

When you run the ping command, it will use either IPv4 or IPv6, depending on your machine DNS settings.

To force ping to use IPv4, pass the -4 option, or use its alias ping4:

ping -4 DESTINATION

For IPv6, pass the -6 option or use ping6:

ping -6 DESTINATION

 

Conclusion

ping is a command-line network utility that allows you to test the IP-level connectivity of a given host on the network.

To view all available options of the ping command, type man ping in your terminal.

Keep reading
How to use chattr command in Linux.
August 14, 2023

How to use chattr command in Linux.

How To Use Chattr Command In Linux. This article explains how to use the chattr command to change file attributes on Linux file systems. In Linux, file attributes are meta-data properties that describe the file’s behavior. For example, an attribute can indicate whether a file is compressed or…

Read article
How to Install Python 3.9 on Debian 10
August 14, 2023

How to Install Python 3.9 on Debian 10

How To Install Python 3.9 On Debian 10 In this article, we’ll show you how to install Python 3.9 on Debian 10. Python 3.9 is the latest major release of the Python language. It includes many new features such as new dict operators, new str functions, support for IANA time zone, and more .…

Read article
How to Install and Configure an NFS Server on Ubuntu 20.04
August 14, 2023

How to Install and Configure an NFS Server on Ubuntu 20.04

How To Install And Configure An NFS Server On Ubuntu 20 This article explains how to set up an NFSv4 Server on Ubuntu 20.04. We’ll also show you how to mount an NFS file system on the client machine. By default, the NFS protocol is not encrypted and does not provide user authentication. Access to…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, cloud hosting, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Support 24/7 · Billing 09:00 – 00:00