首页 > 其他分享 >curl:(6) Could not resolve host: baidu.com; Unknown error

curl:(6) Could not resolve host: baidu.com; Unknown error

时间:2022-09-24 09:45:34浏览次数:160  
标签:baidu resolve Unknown IPV6 yes com

问题描述

有段时间没操作CentOS了,然后启动Virtualbox中的CentOS之后,发现网络不通,ping baidu.com 出现错误 curl:(6) Could not resolve host: baidu.com; Unknown error

解决思路

看了网络配置用的是桥接模式,发现与主机IP不在同一个局域网内,遂调整了一下CentOS的IP地址。

1、编辑文件 /etc/sysconfig/network-scripts/ifcfg-enp0s3

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=d0c16d23-f7b2-4036-84e5-3b0a47debf7f
DEVICE=enp0s3
ONBOOT=yes

IPADDR=192.168.0.80
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
DNS1=114.114.114.114

2、重启网卡

service network restart

标签:baidu,resolve,Unknown,IPV6,yes,com
From: https://www.cnblogs.com/bsmn/p/16724959.html

相关文章