首先,NetworkManager 将我的 DNS 设置为 127.0.0.53。默认情况下没有运行 DNS 服务。我安装了 dnsmasq,但它仍然无法查找名称。我在 resolv.conf.d/head 中添加了一些 dns 服务器,这样当我尝试按名称 ping 时,我就可以使用 nslookup 查找内容,尽管 nslookup 可以工作,但它找不到它。ping google.com 最终确实有效,但需要 10-15 秒才能解决。
gretchen@CyanTechnology:~$ nslookup s3.amazonaws.com
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
s3.amazonaws.com canonical name = s3-1.amazonaws.com.
Name: s3-1.amazonaws.com
Address: 52.216.163.37
gretchen@CyanTechnology:~$ ping 52.216.163.37
PING 52.216.163.37 (52.216.163.37) 56(84) bytes of data.
64 bytes from 52.216.163.37: icmp_seq=1 ttl=50 time=76.7 ms
64 bytes from 52.216.163.37: icmp_seq=2 ttl=50 time=70.2 ms
64 bytes from 52.216.163.37: icmp_seq=3 ttl=50 time=74.0 ms
^C
--- 52.216.163.37 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 70.283/73.703/76.754/2.673 ms
gretchen@CyanTechnology:~$ ping s3.amazonaws.com
ping: s3.amazonaws.com: Name or service not known