Ping — Test Network Connectivity

The ping command checks if another machine is reachable over the network.

  • Sends packets (ICMP Echo Request)
  • Requires an IP address or hostname
  • Continues until Ctrl + C
  • Use -c to limit number of packets

Example:

ping -c 3 google.com
ping -c 3 192.168.1.2

Output shows: alt text

Case Explanation
Why ping may fail? - Device is offline.
- Wrong IP address .
- System or network configured to block ping for security
Ping Hostnames - ping domain names: ping -c 3 google.com
- DNS is working.
- Network connection is active.
- Remote server reachable