HowTo: Edit The /etc/resolv.conf File in CentOS Linux

You need to use the text editor such as vi / vim or joe make changes to /etc/resolv.conf file. You must be logged in as root user in order to change this file. The /etc/resolv.conf is resolver configuration file. You can set nameserver ip address and domain search query name in this file.

Edit File Using Vi

Type the following command:
vi /etc/resolv.conf

Edit as follows and set name server IP address:


Save and close the file. Test new settings either with dig or host command:

  • dns, resolv.conf
  • 25 Users Found This Useful
Was this answer helpful?

Related Articles

How to create your own name servers?

So you're a reseller and you want to have your own name servers? Such as ns.yourdomain.comNo...

What are private nameservers?

Private nameservers are available on certain reseller plans, so that resellers can run their...

How to change the IP address of my nameservers

From time to time it may be necessary to move you to a new range of IPs. For your convenience, we...

DNS stops working after online updates due to "check-name" errors

Situation After updating to SLES 9 SP4, or certain updates with SLES 9 SP3, BIND will not load,...