Skip to content

How to Add DNS on Enterprise Linux 6.5

  • by
Adding a nameserver to a Enterprise Linux 6.5 is similar with changing nameserver:
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
  1. Add a directive DNS2 directly in the interface configuration file.
  2. [root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
    ...
    DNS1=8.8.8.8
    DNS2=168.95.1.1
    DOMAIN=example.com
    ...

  3. Set the directive PEERDNS explicitly to no in the interface configuration file, and then add an entry nameserver in /etc/resolv.conf
  4. [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

Don't forget to restart the network service after any changes.

Further reading -How to Change DNS on Enterprise Linux 6.5

Leave a Reply

Your email address will not be published. Required fields are marked *