Connectivity Testing
ping — Basic Reachability
# Test connection
ping -c 4 google.com
# With timestamp
ping -D -c 4 google.com
traceroute — Path Analysis
# Shows each hop to destination
traceroute example.com
# TCP traceroute (bypasses ICMP blocks)
sudo traceroute -T -p 443 example.com
# MTR — combines ping + traceroute (live updating)
mtr example.com
DNS Troubleshooting
# Quick lookup
dig +short example.com
# Full query with timing
dig example.com
# Query specific record type
dig MX example.com
dig TXT example.com
# Query specific nameserver
dig @8.8.8.8 example.com
# Trace delegation chain
dig +trace example.com
Port Testing
# Check if port is open on remote host
nc -zv example.com 443
# Check multiple ports
nc -zv example.com 80 443 22
# Using nmap
nmap -p 22,80,443 example.com
Connection Analysis
# All listening ports
ss -tlnp
# All established connections
ss -tnp
# Connections to specific port
ss -tnp sport = :443
# Connection count by state
ss -s
Bandwidth Testing
# Install iperf3
sudo apt install -y iperf3
# On server
iperf3 -s
# On client
iperf3 -c server-ip
# Test download speed from internet
curl -o /dev/null -w "Speed: %{speed_download} bytes/sec\n" https://speed.cloudflare.com/__down?bytes=100000000
Common Issues and Fixes
| Symptom | Likely Cause | Diagnostic Command |
|---|---|---|
| Can't reach server | Firewall blocking | sudo ufw status |
| Slow connections | DNS resolution | dig +short +time=2 example.com |
| Intermittent drops | Packet loss | mtr -r -c 100 example.com |
| Port unreachable | Service not running | ss -tlnp \| grep :PORT |
| High latency | Routing issue | traceroute example.com |
Tip When reporting network issues to support, include the output of
mtr -r -c 100 your-server-ip— it gives us everything we need to diagnose the path.