[ GF.dev ] All Tools →

How to Use Ping and Port Scanning for Basic Server Diagnostics

Published 2026-03-29 · Last modified 2026-03-29

When a server isn't responding or a website is down, the first diagnostic step isn't to check application logs or restart services — it's to verify basic network connectivity. Can you reach the server at all? Are the right ports open? Is there packet loss or abnormal latency? Ping and port scanning are the foundational tools that answer these questions in seconds. This guide shows you how to use them effectively, interpret the results, and decide where to investigate next.

Ping: The Simplest Network Diagnostic

Ping sends ICMP Echo Request packets to a target host and measures the time for each Echo Reply. It tells you three things:

  1. Is the host reachable? — If you get replies, the target is alive and the network path between you is functional.
  2. What's the round-trip latency? — The time in milliseconds for a packet to travel to the target and back.
  3. Is there packet loss? — If some packets get replies and others don't, you have an intermittent network problem.

Try it now with the GF.dev Ping Test, which pings from our servers so you can see latency from a different vantage point than your local machine.

Reading Ping Output

A typical ping session looks like this:

$ ping -c 4 example.com
PING example.com (93.184.216.34): 56 data bytes
64 bytes from 93.184.216.34: icmp_seq=0 ttl=56 time=11.632 ms
64 bytes from 93.184.216.34: icmp_seq=1 ttl=56 time=11.726 ms
64 bytes from 93.184.216.34: icmp_seq=2 ttl=56 time=12.152 ms
64 bytes from 93.184.216.34: icmp_seq=3 ttl=56 time=11.448 ms

--- example.com ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 11.448/11.740/12.152/0.252 ms

Key values to examine:

When Ping Fails

If ping returns "Request timeout" or "Destination host unreachable," don't immediately panic. Consider these possibilities:

The takeaway: a failed ping doesn't necessarily mean the server is down. That's why you need port scanning as a complementary diagnostic.

Port Scanning: Verifying Service Availability

While ping tests basic network connectivity, port scanning verifies that specific services are accepting connections. A web server that responds to ping but has port 443 closed isn't going to serve any HTTPS traffic. Use the GF.dev Port Scanner to check which ports are open on your server.

Essential Ports for Web Servers

Port States Explained

When scanning, ports fall into three categories:

Command-Line Port Scanning

For quick checks from your own machine, you don't need a full port scanner. These commands test individual ports:

# Test if port 443 is open (Linux/Mac)
nc -zv example.com 443

# Using Bash built-in (no extra tools needed)
echo > /dev/tcp/example.com/443 && echo "Port open" || echo "Port closed"

# Scan common ports with nmap
nmap -p 22,80,443,3306,5432,8080 example.com

Combining Ping and Port Scanning: A Diagnostic Workflow

Here's a systematic approach when you suspect a server or site is having issues:

  1. Ping the server — Use the GF.dev Ping Test. If it responds, the server is reachable at the network level and you can note the baseline latency.
  2. Scan the HTTP/HTTPS ports — Use the Port Scanner on ports 80 and 443. If these are closed, the web server process has likely crashed or been stopped.
  3. Check TTFB — If ports are open, run a TTFB test. High TTFB with open ports means the server is receiving connections but processing them slowly — an application-layer issue rather than a network issue.
  4. Inspect response headers — Use the HTTP Headers Test to see if the server is responding with errors (5xx status codes) or misconfigured headers.
  5. Verify your own connectivity — Use What Is My IP to confirm your public IP address, especially if you're troubleshooting access from behind a VPN or corporate NAT. Sometimes the problem is that your IP has been blocked by the server's firewall.

Common Scenarios and Diagnoses

Security Considerations

Port scanning your own servers is essential maintenance. However, keep these points in mind:

For a comprehensive approach to server diagnostics beyond network-level checks, see our Web Server Performance Troubleshooting pillar guide, which covers TTFB analysis, header inspection, caching strategies, and monitoring.