排查顺序:先解析,再路由,再端口,最后带宽。每一步用对应工具确认,别一上来就换网络。
第一步:解析(DNS)
| 命令 | 用途 |
|---|---|
dig example.com +short |
看解析结果(推荐) |
nslookup example.com |
Windows / 通用 |
dig @223.5.5.5 example.com |
指定 DNS 对比解析 |
dig +trace example.com |
逐级追踪解析链路 |
解析慢或结果异常 → 见 公共 DNS 页。
第二步:路由与丢包
| 命令 | 用途 |
|---|---|
ping -c 10 host |
延迟 / 丢包 |
traceroute host(Win tracert) |
逐跳路由 |
mtr --report -c 100 host |
路由 + 每跳丢包(推荐) |
mtr -T -P 443 host |
TCP 模式(绕过 ICMP 限速) |
看哪一跳开始丢包 / 延迟跳升,判断是本地、出口还是目标侧问题。
第三步:端口与连通
nc -zv host 443 # 端口是否开放
curl -I -m 10 https://host # HTTP 是否可达
curl -w 'dns=%{time_namelookup} connect=%{time_connect} tls=%{time_appconnect} total=%{time_total}\n' -o /dev/null -s https://host
最后一行把耗时拆成 DNS / TCP / TLS / 总耗时,快速定位慢在哪一段。
第四步:带宽与质量
# 单线程下载测速
curl -o /dev/null -w '%{speed_download} B/s\n' https://host/file
# 多线程(排除单连接限速)
aria2c -x16 -s16 -k1M https://host/file
带宽正常但单线程慢 → 多为单连接限速,见下载与传输技巧。
多地探测网站
| 网站 | 用途 |
|---|---|
| itdog.cn | 国内多地 ping / 测速 / TCP |
| ping.pe | 全球 ping / TCPing / MTR |
| check-host.net | 全球可用性 / 端口检测 |
| 17ce.com | 国内多节点测速 |
| boce.com | 阿里云拨测 |
查 IP / ASN / 路由
| 工具 | 用途 |
|---|---|
| bgp.he.net | ASN / 前缀 / 路由查询 |
| bgp.tools | BGP 路由可视化 |
| ipinfo.io | IP 归属 / ASN / 组织 |
| ip.sb | 本机 IP / 归属 |
| 运营商 Looking Glass | 从对方网络视角 traceroute(搜「运营商名 looking glass」) |