网络不靠猜:一层一层诊断
当网络层可以分别观察时,问题就不再神秘。
一次网页请求由多个问题组成
DNS、服务/端口、TLS、HTTP 都必须分别成立。不要只看浏览器最后的一条错误。
名称不是地址
install ping dns ip tcp curl cert net geodns example.com -a -aaaaip 192.0.2.10/24ip serverlil-terminal 的 `ping` 是 HTTP 检查
它不同于传统 ICMP ping:lil-terminal 会报告 HTTP 状态、最终 URL、耗时和解析到的地址。
ping https://example.com -tping example.com -i地址还需要正确的服务与信任
tcp example.com 443 -tls -icert -h example.comtcp example.com 80HTTP 头经常直接解释问题
curl https://example.com -Icurl https://example.com -i -t 10curl https://example.com -o network-example.html本地接口与 GeoIP 只是上下文
net -lnet -4geo example.com -c保存真正有效的诊断顺序
把同一套只读检查写成脚本,换一台主机也能按相同方法比较结果。
把它保存成脚本
network-check.lil 对 example.com 执行五项只读检查。
#lil
@install ping dns tcp curl cert
ping https://example.com -t
dns example.com -a -aaaa
tcp example.com 443 -tls
curl https://example.com -I
cert -h example.com