您的当前位置:首页 --> Linux 教程 |
Linux Centos7添加DNS |
浏览次数:2140 关键词 ( ) |
方法一:(推荐新方式)
[root@auto-test2 network-scripts]# nmcli connection show NAME UUID TYPE DEVICE ens160 0bd6ac7c-a5aa-4aef-ad6d-2a62949be537 802-3-ethernet ens160 [root@auto-test2 network-scripts]# nmcli con mod ens160 ipv4.dns "114.114.114.114 8.8.8.8" [root@auto-test2 network-scripts]# nmcli con up ens160 Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2) [root@auto-test2 network-scripts]# ping www.baidu.com PING www.a.shifen.com (220.181.111.188) 56(84) bytes of data. 64 bytes from 220.181.111.188 (220.181.111.188): icmp_seq=1 ttl=52 time=2.13 ms 64 bytes from 220.181.111.188 (220.181.111.188): icmp_seq=2 ttl=52 time=2.04 ms 64 bytes from 220.181.111.188 (220.181.111.188): icmp_seq=3 ttl=52 time=2.01 ms 64 bytes from 220.181.111.188 (220.181.111.188): icmp_seq=4 ttl=52 time=3.38 ms 64 bytes from 220.181.111.188 (220.181.111.188):
操作截图:
修改后的效果见图:
方法二:传统方式
[main] plugins=ifcfg-rh dns=none
# systemctl restart NetworkManager.service
nameserver 114.114.114.114 nameserver 8.8.8.8
|
下一条 大于2t的磁盘分区,并格式化ext4挂载 上一条 NetworkManager is not running 解决办法 |
数千企业与站长的选择,7*24小时稳定运行
了解更多套餐详细