除非我按名称查询本地计算机,否则systemd的DNS优先于127.0.0.53。但是,如果我查询它们,并专门指定本地DNS服务器(我的路由器),那么我会得到正确的答复。但是配置文件说它也使用路由器作为搜索地址。有什么想法吗?
我在戴尔笔记本电脑上运行Ubuntu 18.04。
错误的结果:
$ nslookup web1
Server: 127.0.0.53
Address: 127.0.0.53#53
** server can't find web1: SERVFAIL
也失败
$ nslookup -i wlp3s0 web1
nslookup: couldn't get address for 'web1': not found
正确的结果:
$ nslookup web1 192.168.1.1
Server: 192.168.1.1
Address: 192.168.1.1#53
Name: web1
Address: 192.168.1.107
配置信息systemd-resolve
$ systemd-resolve --status
Global
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
168.192.in-addr.arpa
17.172.in-addr.arpa
18.172.in-addr.arpa
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
Link 3 (wlp3s0)
Current Scopes: DNS
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 192.168.1.1
DNS Domain: wp.comcast.net
Link 2 (enp2s0)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
配置信息NetworkManager
$ cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=false
[device]
wifi.scan-rand-mac-address=no
那么我如何获得nslookup返回正确的答案?链接3似乎是正确的信息(我的wifi连接),并且路由器上的DNS返回正确的答案,但是本地缓存从不尝试查找地址(或如此)。
nslookup -i wlp3s0 web1