Skip to main content
⚡ OpenDevDocs
Networking
networkingdeveloper-networkingGuideIntermediate

Developer Network Diagnostic Tools Cheatsheet

Master essential network diagnostic utilities (curl, ping, traceroute, dig, ss, netstat, lsof, netcat) for debugging connectivity.

Verified: 2026-09-30
Tested on:linux Ubuntu 24.04 / Debian 12
Platforms:
linuxmacos
#networking#tools#curl#ping#ss#lsof#diagnostics

1. Quick Diagnostic Decision Matrix

ProblemRecommended ToolCommand Example
Is the remote host reachable?pingping -c 4 1.1.1.1
Where is network latency or packet loss occurring?traceroutetraceroute 8.8.8.8
Is a specific TCP port open on remote host?nc (netcat)nc -zv 192.168.1.10 5432
What is the HTTP status code and response timing?curlcurl -Iv https://example.com
What IP does this domain resolve to?digdig @1.1.1.1 example.com +short
Which local ports are currently listening?sssudo ss -tulpn
Which process/PID is holding port 3000?lsoflsof -i :3000

2. Advanced curl Latency Profiling

Measure exact DNS lookup, TCP connect, TLS handshake, and Time to First Byte (TTFB) durations:

curl -w "DNS: %{time_namelookup}s | TCP: %{time_connect}s | TLS: %{time_appconnect}s | TTFB: %{time_starttransfer}s | Total: %{time_total}s\n" \
  -o /dev/null -s https://docs.tashanto.com

3. Testing Raw TCP Socket Connections with Netcat (nc)

Verify if a database or Redis instance is accepting connections without needing the full DB client installed:

# -z = Zero-I/O mode (scan only); -v = Verbose
nc -zv database.internal.net 5432

4. Socket Inspection with ss

# Show summary statistics of all active socket connections
ss -s

# Filter for active established HTTPS connections
ss -t state established '( dport = :https or sport = :https )'

On this page