已经安装了 resolv.conf 并且它现在基本上将“好” ns 添加到列表中,但仅在最后。
127.0.0.53 (例如)在 github 上挂起和超时。我在同一网络上的笔记本电脑从未出现过此问题,并且似乎自动在 192.158.1.1 上接听。这只是运气吗?
想了解为什么这里的默认设置看起来如此糟糕吗?以及为什么这么多人需要手动干预。他们在其他系统上发现了什么?
编辑/更新:
$ ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 29 Nov 30 10:27 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
$ time nslookup github.com 192.168.1.1
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
Name: github.com
Address: 192.30.253.112
Name: github.com
Address: 192.30.253.113
real 0m0.073s
user 0m0.006s
sys 0m0.005s
$ time nslookup github.com 127.0.0.53
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: github.com
Address: 192.30.253.112
Name: github.com
Address: 192.30.253.113
;; connection timed out; no servers could be reached
real 0m15.012s
user 0m0.008s
sys 0m0.004s
$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 127.0.0.53
nameserver 192.168.1.1
根据 chili555 的一些建议更新 2:
$ ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 37 Dec 1 15:45 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf
$ nslookup github.com
Server: 127.0.0.53
Address: 127.0.0.53#53
** server can't find github.com: SERVFAIL
$ nslookup github.com 192.168.1.1
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
Name: github.com
Address: 192.30.253.112
Name: github.com
Address: 192.30.253.113
$ cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
/etc/resolv.conf 中通常的名称服务器地址 127.0.0.53 一点也不“坏”。它反映 dnsmasq 正在您的系统上运行。
https://help.ubuntu.com/community/Dnsmasq
DNS 查找无法与此名称服务器一起工作的事实通常并不意味着名称服务器和底层 dnsmasq 系统有故障。它通常表明这是 resolvconf 系统中的另一个错误。
/etc/resolv.conf 是符号链接吗?查看:
它与什么相关联?理想情况下,它将是 /run/systemd/resolve/stub-resolv.conf。如果不是,我们需要纠正它。
一旦我们找到有关您的系统的更多详细信息,我们将进行一些修改,并且我将进一步编辑此部分答案。
编辑:我们在您的编辑中看到了这一点:
我们怀疑链接应该是我在上面发布的。请试试:
重新启动并测试。