出现“Could not resolve host: www.github.com; Unknown error”错误解决

举报
江湖有缘 发表于 2023/02/07 22:32:50 2023/02/07
【摘要】 出现“Could not resolve host: www.github.com; Unknown error”错误解决

@[TOC](出现“Could not resolve host: www.github.com; Unknown error”错误解决)

一、报错提示

[root@node-1 ~]# curl www.github.com
curl: (6) Could not resolve host: www.github.com; Unknown error

二、测试外网百度域名访问

[root@node-1 ~]# ping www.baidu.com
ping: unknown host www.baidu.com

三、查看dns配置

[root@node-1 network-scripts]# cat ifcfg-eth0 
TYPE="Ethernet"
BOOTPROTO=none
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="eth0"
UUID="c3b26ff5-82d4-450a-8a3b-e19a19c1bd4c"
DEVICE="eth0"
ONBOOT="yes"
IPADDR=192.168.3.11
PREFIX=24
GATEWAY=192.168.3.254
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes


四、配置dns

[root@node-1 network-scripts]# nmcli con modify eth0 ipv4.dns 192.168.3.254 ipv4.method manual
[root@node-1 network-scripts]# nmcli con reload 
[root@node-1 network-scripts]# nmcli con up eth0 
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)

五、测试外网访问下载

[root@node-1 network-scripts]# ping www.baidu.com -c 4
PING www.a.shifen.com (112.80.248.76) 56(84) bytes of data.
64 bytes from 112.80.248.76: icmp_seq=1 ttl=55 time=22.1 ms
64 bytes from 112.80.248.76: icmp_seq=2 ttl=55 time=22.2 ms
64 bytes from 112.80.248.76: icmp_seq=3 ttl=55 time=22.0 ms
64 bytes from 112.80.248.76: icmp_seq=4 ttl=55 time=21.7 ms

--- www.a.shifen.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 21.785/22.051/22.253/0.231 ms



[root@node-1 ~]# 
[root@node-1 ~]# wget https://dl.360safe.com/360zip_setup.exe
--2021-12-31 23:38:54--  https://dl.360safe.com/360zip_setup.exe
Resolving dl.360safe.com (dl.360safe.com)... 36.32.131.66, 36.32.131.67, 118.212.132.249, ...
Connecting to dl.360safe.com (dl.360safe.com)|36.32.131.66|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14771792 (14M) [application/octet-stream]
Saving to: ‘360zip_setup.exe’

100%[=============================================================================================>] 14,771,792  15.5MB/s   in 0.9s   

2021-12-31 23:38:55 (15.5 MB/s) - ‘360zip_setup.exe’ saved [14771792/14771792]

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。