systemd-resolve 总是返回相同的 ip。DNS 错误

systemd-resolve 总是返回相同的 ip。DNS 错误

我在其他局域网设备上的网络很好。但在我的 ubuntu 服务器上,systemd-resolve 总是返回相同的 ip。

例如:

kiddo@nas:~$ nslookup google.com
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   google.com
Address: 192.168.31.1


kiddo@nas:~$ nslookup facebook.com
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   facebook.com
Address: 192.168.31.1

使用时也发生过这种情况systemd-resolve

kiddo@nas:~$ systemd-resolve google.com
google.com: 192.168.31.1                       -- link: enp1s0

-- Information acquired via protocol DNS in 32.5ms.
-- Data is authenticated: no


kiddo@nas:~$ systemd-resolve facebook.com
facebook.com: 192.168.31.1                     -- link: enp1s0

-- Information acquired via protocol DNS in 27.8ms.
-- Data is authenticated: no

跑步systemd-resolve --status

kiddo@nas:~$ systemd-resolve --status
Global
       LLMNR setting: no
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
          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 8 (vethc080ae2)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 6 (veth4d3c69e)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 4 (br-a6e16f6b0c41)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 3 (docker0)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 2 (enp1s0)
      Current Scopes: DNS
DefaultRoute setting: yes
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
  Current DNS Server: 192.168.31.1
         DNS Servers: 192.168.31.1
                      fe80::6664:4aff:fe8c:f55c
                      fe80::1

我尝试通过的 DNS 服务器解析域名Link 2 (enp1s0)

kiddo@nas:~$ nslookup google.com 192.168.31.1
Server:         192.168.31.1
Address:        192.168.31.1#53

Non-authoritative answer:
Name:   google.com
Address: 172.217.24.110

kiddo@nas:~$ nslookup facebook.com 192.168.31.1
Server:         192.168.31.1
Address:        192.168.31.1#53

Non-authoritative answer:
Name:   facebook.com
Address: 157.240.199.35


kiddo@nas:~$ nslookup google.com fe80::6664:4aff:fe8c:f55c
Server:         fe80::6664:4aff:fe8c:f55c
Address:        fe80::6664:4aff:fe8c:f55c#53

Non-authoritative answer:
Name:   google.com
Address: 172.217.25.14

kiddo@nas:~$ nslookup facebook.com fe80::6664:4aff:fe8c:f55c
Server:         fe80::6664:4aff:fe8c:f55c
Address:        fe80::6664:4aff:fe8c:f55c#53

Non-authoritative answer:
Name:   facebook.com
Address: 157.240.199.35

kiddo@nas:~$ nslookup google.com fe80::1
Server:         fe80::1
Address:        fe80::1#53

** server can't find google.com: REFUSED

kiddo@nas:~$ nslookup facebook.com fe80::1
Server:         fe80::1
Address:        fe80::1#53

** server can't find facebook.com: REFUSED

192.168.31.1并且fe80::6664:4aff:fe8c:f55c看起来工作正常。

我尝试通过 刷新 DNS 缓存systemd-resolve --flush-caches,但没有帮助。

我尝试过systemd-resolve --reset-server-features并且它有帮助。但是过一段时间问题会再次出现。

在我尝试之后systemd-resolve --reset-server-features

kiddo@nas:~$ systemd-resolve google.com
google.com: 142.250.204.110                    -- link: enp1s0

-- Information acquired via protocol DNS in 164.1ms.
-- Data is authenticated: no
kiddo@nas:~$ systemd-resolve facebook.com
facebook.com: 157.240.199.35                   -- link: enp1s0

-- Information acquired via protocol DNS in 163.9ms.
-- Data is authenticated: no


kiddo@nas:~$ nslookup google.com
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   google.com
Address: 142.250.204.110

kiddo@nas:~$ nslookup facebook.com
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   facebook.com
Address: 157.240.199.35

kiddo@nas:~$ systemd-resolve  --status
Global
       LLMNR setting: no
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
          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 8 (vethc080ae2)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 6 (veth4d3c69e)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 4 (br-a6e16f6b0c41)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 3 (docker0)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 2 (enp1s0)
      Current Scopes: DNS
DefaultRoute setting: yes
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
  Current DNS Server: fe80::6664:4aff:fe8c:f55c
         DNS Servers: 192.168.31.1
                      fe80::6664:4aff:fe8c:f55c
                      fe80::1

我该如何解决这个问题?任何想法也许有帮助。谢谢。

相关内容