为什么更新 /etc/hosts 不再起作用?
我该如何调试并使其工作?
cat /etc/hosts:
127.0.0.1 localhost
::1 localhost
# I added this line
127.0.0.1 kakfa
cat /etc/nsswitch.conf
:
hosts: files mdns4_minimal [NOTFOUND=return] dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
cat /etc/resolv.conf
:
nameserver 127.0.0.53
options edns0 trust-ad
search lan
systemd-resolve --status
:
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Link 2 (enp3s0)
Current Scopes: none
Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Link 3 (wlp0s20f3)
Current Scopes: DNS
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.1.1
DNS Servers: 192.168.1.1
DNS Domain: lan
有关的:
答案1
我为 127.0.0.1 写了两行
应该是
127.0.0.1 localhost kakfa
::1 localhost