Ubuntu 22.04 桌面版上的 DNS 未解析

Ubuntu 22.04 桌面版上的 DNS 未解析

今天,Ubuntu 自动更新了 Gnome。

重启后,我无法通过 Firefox 或 Chrome 访问任何网站,无论是通过以太网还是 Wi-Fi

DNS 不再解析。

resolvectl status

Global
       Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub

Link 2 (enp2s0)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported

Link 3 (enp62s0)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported

Link 4 (wlp3s0)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported

Link 5 (enx1eaba7d6e6c9)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported

Link 6 (ipv6leakintrf0)
    Current Scopes: DNS
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: ::1
       DNS Servers: ::1
        DNS Domain: ~.

Link 7 (docker0)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported

我应该怎样修复此问题?


这是一些命令的结果,希望有人能帮忙。

ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 3c:07:54:0f:db:0c brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.18/24 brd 192.168.1.255 scope global dynamic noprefixroute enp2s0
       valid_lft 83552sec preferred_lft 83552sec
    inet6 2a01:cb1d:8065:ff00:99b3:d756:827f:a773/64 scope global temporary dynamic 
       valid_lft 86401sec preferred_lft 601sec
    inet6 2a01:cb1d:8065:ff00:d211:e869:1b78:4e94/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 86401sec preferred_lft 601sec
    inet6 fe80::c642:9766:63a5:aa4b/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: enp62s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 38:c9:86:32:b4:38 brd ff:ff:ff:ff:ff:ff
4: wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether e4:ce:8f:51:2a:14 brd ff:ff:ff:ff:ff:ff
5: enx1eaba7d6e6c9: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 1e:ab:a7:d6:e6:c9 brd ff:ff:ff:ff:ff:ff
6: ipv6leakintrf0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether 22:af:bf:5d:77:7d brd ff:ff:ff:ff:ff:ff
    inet6 fdeb:446c:912d:8da::/64 scope global noprefixroute 
       valid_lft forever preferred_lft forever
    inet6 fe80::3674:2c39:7a8e:a7e4/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
7: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:72:98:5e:fb brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever

ip route

default via 192.168.1.1 dev enp2s0 proto dhcp metric 100 
169.254.0.0/16 dev enp2s0 scope link metric 1000 
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 
192.168.1.0/24 dev enp2s0 proto kernel scope link src 192.168.1.18 metric 100 

ip neigh

192.168.1.1 dev enp2s0 lladdr 30:7c:b2:8c:a0:56 STALE
192.168.1.15 dev enp2s0 lladdr a4:5e:60:ca:ff:09 STALE
fe80::327c:b2ff:fe8c:a056 dev enp2s0 lladdr 30:7c:b2:8c:a0:56 router REACHABLE
2a01:cb1d:8065:ff00:d886:7401:1e05:11ff dev enp2s0 lladdr a4:5e:60:ca:ff:09 STALE

ping 8.8.8.8

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=50.1 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=18.6 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=116 time=41.9 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=116 time=48.7 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=116 time=68.6 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=116 time=18.9 ms
64 bytes from 8.8.8.8: icmp_seq=8 ttl=116 time=72.1 ms
64 bytes from 8.8.8.8: icmp_seq=9 ttl=116 time=85.3 ms
64 bytes from 8.8.8.8: icmp_seq=10 ttl=116 time=36.7 ms
^C
--- 8.8.8.8 ping statistics ---
10 packets transmitted, 9 received, 10% packet loss, time 9026ms
rtt min/avg/max/mdev = 18.589/48.995/85.270/21.767 ms

dig google.com

; <<>> DiG 9.18.1-1ubuntu1.1-Ubuntu <<>> google.com
;; global options: +cmd
;; connection timed out; no servers could be reached

ping 1.1.1.1

PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=64 time=0.520 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=64 time=0.438 ms
64 bytes from 1.1.1.1: icmp_seq=3 ttl=64 time=0.433 ms
64 bytes from 1.1.1.1: icmp_seq=4 ttl=64 time=0.459 ms
64 bytes from 1.1.1.1: icmp_seq=5 ttl=64 time=0.472 ms
^C
--- 1.1.1.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4073ms
rtt min/avg/max/mdev = 0.433/0.464/0.520/0.031 ms

dig google.com @1.1.1.1

; <<>> DiG 9.18.1-1ubuntu1.1-Ubuntu <<>> google.com @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45260
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;google.com.            IN  A

;; ANSWER SECTION:
google.com.     24  IN  A   142.250.74.110

;; Query time: 19 msec
;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
;; WHEN: Wed Aug 31 00:32:36 CEST 2022
;; MSG SIZE  rcvd: 55

答案1

这是我的错误。我删除了 Proton VPN,但忘记了一条指令,这仍然阻止了 DNS 解析。

来自Proton VPN 文档


3. 如果你已卸载该应用程序,请禁用 Kill Switch

可以从官方 Linux 应用程序中轻松禁用 Kill Switch,但如果您先卸载应用程序而不禁用 Kill Switch,则无法禁用 Kill Switch。这可能会导致您的系统无法访问互联网。要在卸载应用程序后删除 Kill Switch,请执行以下操作:

a) 通过运行以下命令识别 Proton VPN 连接名称:

nmcli connection show --active

这将显示系统所有活动连接的列表。

b) 查找与 pvpn 的任何连接 - 这通常包括 pvpn-killswitch 和 pvpn-ipv6leak-protection,并且可能包括 pvpn-routed-killswitch。使用以下命令删除所有这些连接:

nmcli connection delete [connection name]

例如:

nmcli connection delete pvpn-killswitch

c) 重新运行以下命令以验证 Proton VPN 连接已被删除:

nmcli connection show --active

如果仍有 Proton VPN 连接,请按照上述说明删除它们。

相关内容