版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/JasonHector/article/details/78657532 </div>
<link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-f57960eb32.css">
<div id="content_views" class="markdown_views prism-atom-one-dark">
<!-- flowchart 箭头图标 勿删 -->
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"><path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path></svg>
<p>没有配置DNS会引起的问题</p>
yum命令
ssh命令等不能进行
错误:
Could not resolve host: centos.ustc.edu.cn;
本文例子: CentOS7 下DNS配置
网络适配器设置,这个地方选择nat模式和桥接模式都可以
1.root权限登录终端 输入
$ ip add
ens33 为我的名字 记下
2.查找配置文件
扫描二维码关注公众号,回复:
5812834 查看本文章
$ cd /etc/sysconfig/network-scripts/
$ ls
找到刚才对应的名字
$ vi ifcfg-ens33
最底下
ONBOOT = yes
3.关机重启,然后ping 一下网站看看是否能通
$ shutdown -r now
百度为例
$ping www.baidu.com
4.重新查看
$ ip add
记录下ip地址
5.进行配置文件添加配置,截止这一步ip已经设置完成,后续工作其实不需要进行
$ cd /etc/sysconfig/network-scripts/
修改原先文件
$ vi ifcfg-ens33
后两行最后都为1就可以
6.保存退出 重启
$ shutdown -r now
执行yum 操作
$ yum install perl*
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/JasonHector/article/details/78657532 </div>
<link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-f57960eb32.css">
<div id="content_views" class="markdown_views prism-atom-one-dark">
<!-- flowchart 箭头图标 勿删 -->
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"><path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path></svg>
<p>没有配置DNS会引起的问题</p>