Ubuntu 18 Headless 中偶尔出现的 DNS 问题

Ubuntu 18 Headless 中偶尔出现的 DNS 问题

当我尝试更新或安装 SW 时,我看到与 DNS 相关的零星错误:

W: Failed to fetch http://archive.canonical.com/ubuntu/dists/bionic/InRelease System error resolving 'archive.canonical.com:http' - getaddrinfo (16: Device or resource busy)

但实际上大多数 DNS 操作似乎都很好......

$ nslookup google.com
Server:     127.0.0.53
Address:    127.0.0.53#53

Non-authoritative answer:
Name:   google.com
Address: 172.217.7.14
Name:   google.com
Address: 2607:f8b0:4006:800::200e

我的 netplan yaml 文件:

network:
    ethernets:
            enp2s0:
                    dhcp4: true
    version: 2

/etc/resolv.conf

nameserver 127.0.0.53
options edns0

跟踪路由:

$ traceroute ubuntu.com
ubuntu.com: System error
Cannot handle "host" cmdline arg `ubuntu.com' on position 1 (argc 1)

挖:

$ dig ubuntu.com

; <<>> DiG 9.11.3-1ubuntu1.13-Ubuntu <<>> ubuntu.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44836
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1

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

;; ANSWER SECTION:
ubuntu.com.     99  IN  A   91.189.91.44
ubuntu.com.     99  IN  A   91.189.88.180
ubuntu.com.     99  IN  A   91.189.88.181
ubuntu.com.     99  IN  A   91.189.91.45

;; Query time: 2939 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Sat Sep 19 07:04:30 UTC 2020
;; MSG SIZE  rcvd: 103

主机文件:

cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

nsswitch.conf:

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat systemd
group:          compat systemd
shadow:         compat
gshadow:        files

hosts:          files dns carmona
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

编辑:发布信息..

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:    18.04
Codename:   bionic

第二次编辑:输出systemd-resolv --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 2 (enp2s0)
  Current Scopes: DNS
   LLMNR setting: yes
MulticastDNS setting: no
  DNSSEC setting: no
DNSSEC supported: no
     DNS Servers: 209.222.18.218
                  209.222.18.222

答案1

因此,我可以通过升级到 Ubuntu 20(LTS)并将我的 DNS 提供商切换到 Cloudflare 来解决此问题。

相关内容