无法访问此网站

无法访问此网站

当我尝试查看 StackExchange 网站上一篇文章中的图片时,我很惊讶地在 Ubuntu 18.04 上的 Chromium 中看到了这个错误消息:

无法访问此网站

i.stack.imgur.com找不到 的服务器 IP 地址。

DNS_PROBE_FINISHED_NXDOMAIN

为了弄清楚发生了什么,我尝试tcpdump查看 DNS 请求和响应。我尝试重新加载出现错误的图像,这是我看到的 DNS 流量:

# tcpdump -pni any 'port 53'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
20:10:17.618041 IP 127.0.0.1.42714 > 127.0.0.53.53: 3068+ A? i.stack.imgur.com. (35)
20:10:17.618080 IP 127.0.0.1.42714 > 127.0.0.53.53: 23569+ AAAA? i.stack.imgur.com. (35)
20:10:17.618861 IP 127.0.0.53.53 > 127.0.0.1.42714: 3068 13/0/0 CNAME i.stack.imgur.com.cdn.cloudflare.net., A 104.16.0.35, A 104.16.26.34, A 104.16.2.35, A 104.16.30.34, A 104.16.28.34, A 104.16.24.34, A 104.16.25.34, A 104.16.29.34, A 104.16.27.34, A 104.16.3.35, A 104.16.1.35, A 104.16.31.34 (277)
20:10:17.619395 IP 127.0.0.53.53 > 127.0.0.1.42714: 23569| 16/0/0 CNAME i.stack.imgur.com.cdn.cloudflare.net., AAAA 2001:67c:2b0:db32:0:1:6810:1f22, AAAA 2001:67c:2b0:db32:0:1:6810:1b22, AAAA 64:ff9b::6810:23, AAAA 2001:67c:2b0:db32:0:1:6810:223, AAAA 2001:67c:27e4:64::6810:123, AAAA 64:ff9b::6810:1f22, AAAA 2001:67c:27e4:64::6810:1f22, AAAA 2001:67c:27e4:64::6810:223, AAAA 2001:67c:27e4:64::6810:1b22, AAAA 2001:67c:27e4:64::6810:1922, AAAA 2001:67c:2b0:db32:0:1:6810:1d22, AAAA 64:ff9b::6810:123, AAAA 2001:67c:2b0:db32:0:1:6810:1e22, AAAA 64:ff9b::6810:1822, AAAA 2001:67c:2b0:db32:0:1:6810:1822 (505)

如您所见,DNS解析成功。但Chromium仍然向我显示相同的NXDOMAIN错误消息。当查找确实成功时,是什么原因导致Chromium报告NXDOMAIN?

答案1

查看启动板错误18044871805027解决 systemd-resolve 问题。解决方法
1) 添加软件包 libnss-resolve。2 ) 直接在s 链接
中使用名称服务器(或将链接从 重定向到/etc/resolve.conf/run/systemd/resolve/stub-resolve.conf/run/systemd/resolve/resolve.conf

相关内容