以下是一些信息

以下是一些信息

我全新安装了 ubuntu 18.04 服务器,但无法通过自己的 LAN 内的主机名进行 ping 操作。
在执行安装之前,安装程序已更新为新安装程序版本。

ping: rpi3: Temporary failure in name resolution
  • Ubuntu 能够通过本地 LAN 内的 IP ping 通所有内容
  • Ubuntu 可以 ping 通 www.google.com
  • Ubuntu 无法通过 LAN 内的主机名 ping 通任何东西(防火墙、Windows PC、Raspberry Pi)
  • Windows PC 可以通过主机名 ping ubuntu
  • Windows PC 能够通过主机名 ping rpi3

我在 MacBook Pro 2012(家用)、Hyper-V(家用)和 VMware vSphere(公司)上安装了 Ubuntu 18.04。
在所有这些安装过程中,错误仍然存​​在。

我尝试过

  • 更改 /etc/resolv.conf 中的名称服务器
  • 更改 /etc/systemd/resolved.conf 并重新启动 systemd-resolved
  • 完全禁用 systemd-resolved

以下是一些信息

ip地址显示

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: enp1s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 10:dd:a8:c4:6b:bc brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.3/24 brd 192.168.10.255 scope global enp1s0f0
       valid_lft forever preferred_lft forever
    inet6 fe80::12dd:b1ff:fec4:6bbc/64 scope link
       valid_lft forever preferred_lft forever

路由

default via 192.168.10.1 dev enp1s0f0 proto static
192.168.10.0/24 dev enp1s0f0 proto kernel scope link src 192.168.10.3

/etc/网络/接口

# ifupdown has been replaced by netplan(5) on this system.  See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
#    sudo apt install ifupdown

/etc/netplan/50-cloud-init.yaml

network:
    ethernets:
        enp1s0f0:
            addresses:
            - 192.168.10.3/24
            gateway4: 192.168.10.1
            nameservers:
                addresses:
                - 192.168.10.1
    version: 2

/etc/resolv.conf(到 /run/systemd/resolve/stub-resolv.conf 的符号链接)

nameserver 127.0.0.53
options edns0

systemd-resolve --status

Global
         DNS Servers: 192.168.10.1
          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa
                      (and so many more)
                      corp
                      d.f.ip6.arpa
                      home
                      internal
                      intranet
                      lan
                      local
                      private
                      test

Link 2 (enp1s0f0)
      Current Scopes: DNS
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 192.168.10.1

/etc/nsswitch.conf

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

hosts:          files dns
networks:       files

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

netgroup:       nis

nslookup ubuntu.com

Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   ubuntu.com
Address: 91.189.91.44
Name:   ubuntu.com
Address: 91.189.88.180
Name:   ubuntu.com
Address: 91.189.91.45
Name:   ubuntu.com
Address: 91.189.88.181
Name:   ubuntu.com
Address: 2001:67c:1562::1f
Name:   ubuntu.com
Address: 2001:67c:1360:8001::2c
Name:   ubuntu.com
Address: 2001:67c:1562::20
Name:   ubuntu.com
Address: 2001:67c:1360:8001::2b

访问 ubuntu.com

; <<>> DiG 9.11.3-1ubuntu1.11-Ubuntu <<>> ubuntu.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18380
;; 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.             575     IN      A       91.189.91.44
ubuntu.com.             575     IN      A       91.189.88.181
ubuntu.com.             575     IN      A       91.189.91.45
ubuntu.com.             575     IN      A       91.189.88.180

;; Query time: 39 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Wed Apr 29 21:28:12 CEST 2020
;; MSG SIZE  rcvd: 103

相关内容