centos 添加域名解析

http://www.pubyun.com/blog/announce/centos-7-%E4%B8%8B%EF%BC%8C%E5%A6%82%E4%BD%95%E8%AE%BE%E7%BD%AEdns%E6%9C%8D%E5%8A%A1%E5%99%A8/

使用传统方法,手工修改 /etc/resolv.conf

  • 修改 /etc/NetworkManager/NetworkManager.conf 文件,在main部分添加 “dns=none” 选项:
[main]
plugins=ifcfg-rh
dns=none
  • NetworkManager重新装载上面修改的配置
# systemctl restart NetworkManager.service
  • 手工修改 /etc/resolv.conf
nameserver 114.114.114.114
nameserver 8.8.8.8

你可能感兴趣的:(linux,centos,域名,dns)