分页: 1 / 2

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

发表于 : 2018-10-25 13:21
tiffany
/etc/resolv.cnf,这是关联的/run/systemd/resolv/stub-resolv.conf
/etc/resolv.cnf,这是关联的/run/systemd/resolv/stub-resolv.conf
因为安装好默认etc下的resolv.conf文件的内容是关联/run/systemd/resolv/stub-resolv.conf 文件,这个文件的内容我无法写法,重启后会失效。
故而 我删除了 /etc/resolv.conf , 将/run/systemd/resolv/resolv.conf 关联到 etc下的resolv.conf
/etc/resolv.cnf,这是关联的/run/systemd/resolv/stub-resolv.conf
/etc/resolv.cnf,这是关联的/run/systemd/resolv/stub-resolv.conf
这是 /etc/netplan/50-cloud-init.yaml 文件
50-cloud-init.yaml
50-cloud-init.yaml
结果
结果
4%B2~1B01CMMRVTX3B~C5S0.png (8.86 KiB) 查看 16734 次
apt update 也会报错
apt update
apt update
还请知道的朋友帮帮忙

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

发表于 : 2018-10-25 15:00
poloshiao
8.8.8.8 是 谷歌的 dns 網址
是否已被阻檔
請先確認

如果不確定 先試試其它為被阻擋的 dns

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

发表于 : 2018-10-25 15:05
poloshiao
50-cloud-init.yaml
1. 如果你修改這個 可能需要重新開機 或 重新啟動網路 才會生效
我删除了 /etc/resolv.conf , 将/run/systemd/resolv/resolv.conf 关联到 etc下的resolv.conf
建議
2. 直接在 /etc/resolv.conf 修改
這樣是 一次性 生效
2-1. 重新開機 或 重新啟動網路 就被更新了內容

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

发表于 : 2018-10-25 16:08
tiffany
poloshiao 写了: 2018-10-25 15:05
50-cloud-init.yaml
1. 如果你修改這個 可能需要重新開機 或 重新啟動網路 才會生效
我删除了 /etc/resolv.conf , 将/run/systemd/resolv/resolv.conf 关联到 etc下的resolv.conf
建議
2. 直接在 /etc/resolv.conf 修改
這樣是 一次性 生效
2-1. 重新開機 或 重新啟動網路 就被更新了內容
我这样修改过,没有用 还是ping 不通 baid.com

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

发表于 : 2018-10-25 16:33
tiffany
poloshiao 写了: 2018-10-25 15:00 8.8.8.8 是 谷歌的 dns 網址
是否已被阻檔
請先確認

如果不確定 先試試其它為被阻擋的 dns
我 ping 8.8.8.8 ping 通了,但是www.baidu.com 无法ping通
resolv.conf 文件内写的 nameserver 223.5.5.5
5]GR(6W{](43ONZOGWMAH6I.png

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

发表于 : 2018-10-25 17:21
poloshiao
但是www.baidu.com 无法ping通
1. ping -c 3 www.baidu.com
PING www.a.shifen.com (14.215.177.39) 56(84) bytes of data.
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=1 ttl=47 time=219 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=2 ttl=47 time=187 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=3 ttl=47 time=242 ms

--- www.a.shifen.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 3ms
rtt min/avg/max/mdev = 187.433/215.854/241.578/22.186 ms

2. ping -c 3 www.a.shifen.com
PING www.a.shifen.com (14.215.177.39) 56(84) bytes of data.
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=1 ttl=47 time=298 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=2 ttl=47 time=273 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=3 ttl=47 time=270 ms

--- www.a.shifen.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 4ms
rtt min/avg/max/mdev = 270.248/280.474/297.809/12.330 ms

3. 試試
ping -c 3 14.215.177.39

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

发表于 : 2018-10-25 17:59
tiffany
poloshiao 写了: 2018-10-25 17:21
但是www.baidu.com 无法ping通
1. ping -c 3 www.baidu.com
PING www.a.shifen.com (14.215.177.39) 56(84) bytes of data.
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=1 ttl=47 time=219 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=2 ttl=47 time=187 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=3 ttl=47 time=242 ms

--- www.a.shifen.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 3ms
rtt min/avg/max/mdev = 187.433/215.854/241.578/22.186 ms

2. ping -c 3 www.a.shifen.com
PING www.a.shifen.com (14.215.177.39) 56(84) bytes of data.
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=1 ttl=47 time=298 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=2 ttl=47 time=273 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=3 ttl=47 time=270 ms

--- www.a.shifen.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 4ms
rtt min/avg/max/mdev = 270.248/280.474/297.809/12.330 ms

3. 試試
ping -c 3 14.215.177.39

这是我 输入 ping -c 3 14.215.177.39 的结果:
${O(A8NS[HUVB404K0NQR6A.png
${O(A8NS[HUVB404K0NQR6A.png (9.93 KiB) 查看 16606 次

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

发表于 : 2018-10-25 19:09
poloshiao
这是我 输入 ping -c 3 14.215.177.39 的结果:
1. ping -c 3 14.215.177.39
PING 14.215.177.39 (14.215.177.39) 56(84) bytes of data.
64 bytes from 14.215.177.39: icmp_seq=1 ttl=47 time=229 ms
64 bytes from 14.215.177.39: icmp_seq=2 ttl=47 time=214 ms
64 bytes from 14.215.177.39: icmp_seq=3 ttl=47 time=214 ms

--- 14.215.177.39 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 4ms
rtt min/avg/max/mdev = 214.022/219.244/229.423/7.198 ms

2. whois 14.215.177.39
... (略)
inetnum: 14.208.0.0 - 14.223.255.255
netname: CHINANET-GD
descr: CHINANET Guangdong province network
... (略)

3. 你可以再試試
dig www.baidu.com

4. 補充
我得到的回應資料 僅供參考 跟你的 不一定一樣

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

发表于 : 2018-10-26 10:20
tiffany
poloshiao 写了: 2018-10-25 19:09
这是我 输入 ping -c 3 14.215.177.39 的结果:
1. ping -c 3 14.215.177.39
PING 14.215.177.39 (14.215.177.39) 56(84) bytes of data.
64 bytes from 14.215.177.39: icmp_seq=1 ttl=47 time=229 ms
64 bytes from 14.215.177.39: icmp_seq=2 ttl=47 time=214 ms
64 bytes from 14.215.177.39: icmp_seq=3 ttl=47 time=214 ms

--- 14.215.177.39 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 4ms
rtt min/avg/max/mdev = 214.022/219.244/229.423/7.198 ms

2. whois 14.215.177.39
... (略)
inetnum: 14.208.0.0 - 14.223.255.255
netname: CHINANET-GD
descr: CHINANET Guangdong province network
... (略)

3. 你可以再試試
dig www.baidu.com

4. 補充
我得到的回應資料 僅供參考 跟你的 不一定一樣

这是操作dig www.baidu.com 、 whois 14.215.177.39 , 我发现 whois 并没有安装,我在执行 apt install whois 报错了
dig www.baidu.com  、 whois 14.215.177.39
dig www.baidu.com 、 whois 14.215.177.39
apt install  whois
apt install whois

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

发表于 : 2018-10-26 10:45
astolia
@poloshiao 又来瞎搅和一大堆。Destination Host Unreachable说明网络链路都没有通,你在dns解析上绕半天有屁用
这种情况基本都是虚拟机网络设置问题,如果没有特殊需求,直接把连接方式选成 网络地址转换(NAT) ,让虚拟机用宿主机的网络就行了。另外也可查一下是不是宿主机上的防火墙软件把virtualbox的网络请求给拦了

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

发表于 : 2018-10-26 10:51
tiffany
apt install whois 出现问题,所以我更换了源为阿里云的源:
`RD%]55`%D)BTH%8X`RRC(1.png

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

发表于 : 2018-10-26 10:52
poloshiao
Destination Host Unreachable说明网络链路都没有通
我 ping 8.8.8.8 ping 通了,但是www.baidu.com 无法ping通
1. 心中存疑
當然需要提問者 提供他的數據
我发现 whois 并没有安装,我在执行 apt install whois 报错了
2. 終端機指令及文字回應
請直接複製貼上來 (包含指令及回應文字)
不要摘錄 不要擷圖
方便回文直接引用你貼上來的資料
方便你閱讀

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

发表于 : 2018-10-26 10:58
tiffany
astolia 写了: 2018-10-26 10:45 @poloshiao 又来瞎搅和一大堆。Destination Host Unreachable说明网络链路都没有通,你在dns解析上绕半天有屁用
这种情况基本都是虚拟机网络设置问题,如果没有特殊需求,直接把连接方式选成 网络地址转换(NAT) ,让虚拟机用宿主机的网络就行了。另外也可查一下是不是宿主机上的防火墙软件把virtualbox的网络请求给拦了
我设置了两个网卡 1、网络地址转换NAT 2、仅主机(Host-Only)网络
P8}90M99Z9@H%6XR4R{``1E.png
@48%KH2@V8T)}3}H8HRC(ZR.png

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

发表于 : 2018-10-26 11:00
tiffany
poloshiao 写了: 2018-10-26 10:52
Destination Host Unreachable说明网络链路都没有通
我 ping 8.8.8.8 ping 通了,但是www.baidu.com 无法ping通
1. 心中存疑
當然需要提問者 提供他的數據
我发现 whois 并没有安装,我在执行 apt install whois 报错了
2. 終端機指令及文字回應
請直接複製貼上來 (包含指令及回應文字)
不要摘錄 不要擷圖
方便回文直接引用你貼上來的資料
方便你閱讀
报错文字过多,我没法手打出来,在Orecle VM 虚拟机里无法复制

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

发表于 : 2018-10-26 11:23
astolia
tiffany 写了: 2018-10-26 10:58 我设置了两个网卡 1、网络地址转换NAT 2、仅主机(Host-Only)网络
我就知道是这种事。你要弄两个网卡没关系,但一定要弄好路由表。你的问题就出在请求走的是仅主机(Host-Only)网络,根本无法与外界联通。
用ip route看当前的路由表,default是否有两个,或者只有一个但是仅主机(Host-Only)网络的那个
我没用netplan,你可以参考 https://askubuntu.com/a/1043546 禁用仅主机网络的默认路由设置