连通性
ping -c 4 1.1.1.1
traceroute 1.1.1.1
mtr -rw 1.1.1.1
mtr 比 traceroute 好用,能持续统计每一跳的丢包率。
端口
nc -zv host 443
curl -vI https://host
DNS
dig +short example.com
dig @8.8.8.8 example.com A
dig +trace example.com
+trace 能看到从根域一路解析下来的过程,排查 DNS 问题很有用。
HTTP
curl -o /dev/null -s -w "%{http_code} %{time_total}\n" https://host
一次看状态码和耗时。