Oracle VM 安装Ubuntu 18.04 LTS 无法ping 通百度,提示:temporary failure in name resolution

包含网卡/无线网的网络问题和ADSL/校园网/宽带拨号支持及代理/共享等网络使用问题
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: Oracle VM 安装Ubuntu 18.04 LTS 无法ping 通百度,提示:temporary failure in name resolution

#16

帖子 poloshiao » 2018-10-26 11:42

Destination Host Unreachable说明网络链路都没有通
把下面指令 複製 貼進終端機 執行
1. tracepath www.baidu.com
2. traceroute www.baidu.com
2-1. traceroute 需要安裝額外套件
幫你確認 你的網路通到哪裡 ?
在Orecle VM 虚拟机里无法复制
3. 在 Desktop 環境 應該可以複製
在 console 環境 (tty 界面) 可以借助其它套件幫忙 (需要 再貼文)
tiffany
帖子: 10
注册时间: 2018-10-25 12:48
系统: Ubuntu

Re: Oracle VM 安装Ubuntu 18.04 LTS 无法ping 通百度,提示:temporary failure in name resolution

#17

帖子 tiffany » 2018-10-26 13:13

我已经解决了这个问题,现在已经可以 ping www.baidu.com 。我修改了 50-cloud-init.yaml 、 resolv.conf 文件
~6R~E{0TUC6EM711GUVHOHM.png
这是 50-cloud-init.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
enp0s3:
addresses: []
dhcp4: true
optional: true
enp0s8:
addresses:
- 192.168.56.110/24
nameservers:
addresses: []
search: []
optional: true
version: 2


/run/systemd/resolve/resolv.conf

# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 192.168.2.1
search lan
deploy@deploy:/etc$


这里需要特别注意 etc下的 resolv.con 文件是链接到/run/systemd/resolve目录下的那个文件。ubuntu 18.04 默认是链接到 /run/systemd/resolve/stub-resolv.conf 文件的
tiffany
帖子: 10
注册时间: 2018-10-25 12:48
系统: Ubuntu

Re: Oracle VM 安装Ubuntu 18.04 LTS 无法ping 通百度,提示:temporary failure in name resolution

#18

帖子 tiffany » 2018-10-26 13:14

poloshiao 写了: 2018-10-26 11:42
Destination Host Unreachable说明网络链路都没有通
把下面指令 複製 貼進終端機 執行
1. tracepath www.baidu.com
2. traceroute www.baidu.com
2-1. traceroute 需要安裝額外套件
幫你確認 你的網路通到哪裡 ?
在Orecle VM 虚拟机里无法复制
3. 在 Desktop 環境 應該可以複製
在 console 環境 (tty 界面) 可以借助其它套件幫忙 (需要 再貼文)
在没有配置好网络的情况下 shell无法链接 tty类的工具无法登陆使用的
回复