How to configure DNS on CentOS

Configuring DNS always differs depending on the operating system you are using. On CentOS, Fedora or other Red Hat distributions you will find that the easiest way of amending this is via the ifcfg-eth0 file.

$ sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0

Then amend the following lines to whatever you want:

DNS1=8.8.8.8
DNS2=8.8.4.4

The above will not require a reboot.


1 Comment » for How to configure DNS on CentOS
  1. Anthony says:

    I always forget where this file is located. Thanks!

Leave a Reply

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

*