Ping is a very frequently used utility that is primarily used to determine network connectivity. This is useful for determining if the network is properly connected and for the state of the network connection. To put it simply, ping is a test program. If the ping is running correctly, the faults of the network access layer, network card, modem input and output lines, cables and routers can be eliminated, thus narrowing the problem.
Ping can display the amount of time between sending a request and returning a response in milliseconds. If the response time is short, it means that the datagram does not have to go through too many routers or networks, and the connection speed is faster. The ping can also display the TTL (Time To Live) value. The TTL value can be used to estimate how many routers the packet passes.
(1) Command format
Ping hostname
Ping domain
Ping IP address

As shown in the figure, use the ping command to check the connectivity of the computer with the IP address 210.43.16.17. This example is normal. A total of four test packets were sent and four packets were received correctly.
(2) Basic application of the ping command
In general, users can use a series of ping commands to find out where the problem is, or to verify that the network is running.
A typical test sequence and corresponding possible faults are given below:
① ping 127.0.0.1
If the test is successful, it indicates that the network card, TCP/IP protocol installation, IP address, and subnet mask are set properly. If the test is unsuccessful, it indicates that there is a problem with the installation or setup of TCP/IP.
② ping the local IP address
If the test is unsuccessful, it indicates that there is a problem with the local configuration or installation. Network devices and communication media should be tested, checked, and excluded.
③ ping other IPs in the LAN
If the test is successful, the network card and carrier in the local network are running correctly. However, if you receive 0 echo responses, it means that the subnet mask is incorrect or the network card is configured incorrectly or there is a problem with the cable system.
④ ping gateway IP
If this command is answered correctly, it means that the gateway router in the LAN is running and able to respond.
⑤ ping remote IP
If a correct response is received, the default gateway is successfully used. For dial-up users, it means that they can successfully access the Internet (but not to rule out the ISP's DNS).
⑥ ping localhost
Local host is the system's network reserved name, which is an alias for 127.0.0.1, and each computer should be able to translate the name into that address. Otherwise, there is a problem in the host file (/Windows/host).
⑦ ping www.yahoo.com (a famous website domain name)
To execute the Ping command on this domain name, the computer must first convert the domain name to an IP address, usually through a DNS server. If there is a failure here, it means that the IP address of the local DNS server is not configured correctly, or the DNS server it accesses is faulty.
If all the ping commands listed above work properly, then there is basically no problem with the local and remote communication of the computer. However, the success of these commands does not mean that all your network configurations are ok. For example, some subnet mask errors may not be detected by these methods.
(3) Common parameter options for the ping command
Ping IP -t: pings the IP address continuously until it is interrupted by the user with Ctrl+C.
Ping IP -l 2000: Specifies the specific data length in the ping command (here 2000 bytes) instead of the default 32 bytes.
Ping IP -n 20: A ping command that executes a specific number of times (here 20).
Note: As the firewall function is widely used in the network, when you ping other hosts or other hosts to ping your host, and the display host is unreachable, do not rush to conclusions. It's best to compare the ping results with a "well-set" host.