Check if port is open
nc -zv example.com 80
List all listening ports
ss -tuln
Or with netstat:
netstat -tuln
Show active connections
ss -tup
Ping a server
ping -c 4 google.com
Trace route to destination
traceroute google.com
Test HTTP endpoint
curl https://api.example.com/health
POST JSON data
curl -X POST https://api.example.com/users \
-H "Content-Type: application/json" \
-d '{"name": "John", "email": "john@example.com"}'
Download file with curl
curl -O https://example.com/file.zip
Check DNS resolution
nslookup example.com
Or with dig:
dig example.com
Show network interfaces
ip addr show
Test TCP connection speed
iperf3 -c server-ip