代码改变世界

Centos7修改dns的方法

2021-05-31 14:02  狼人:-)  阅读(441)  评论(0编辑  收藏  举报

修改/etc/resolv.conf文件#

Copy
[root@localhost ~]# vim /etc/NetworkManager/NetworkManager.conf
修改或添加dns=none
[main]
#plugins=ifcfg-rh,ibft
dns=none
保存后重启服务
[root@localhost ~]# systemctl restart NetworkManager.service
然后修改/etc/resolv.conf文件
[root@localhost ~]# vim /etc/resolv.conf
# Generated by NetworkManager
nameserver 114.114.114.114
nameserver 8.8.8.8
修改后保持即可

 

 

https://www.cnblogs.com/alusss/p/12631133.html#3887316758