How to Change DNS on Enterprise Linux 6.5
Therefore, I will keep this post as simple as possible. You have two ways to change DNS
- Add a directive DNS2 directly in the interface configuration file.
- Set the directive PEERDNS explicitly to no in the interface configuration file, and then add an entry nameserver in /etc/resolv.conf
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
...
DNS1=8.8.8.8
DNS2=168.95.1.1
DOMAIN=example.com
...
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
...
NAME="System eth0"
PEERDNS=no
[root@localhost ~]# vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 168.95.1.1
search example.com