Adding Nameservers

Sometimes When a server is provisioned the DHCP doesnt set the Nameservers correctly


These Directions will help you set the namesevrers so that your system can resolve hostnames.

We need to Remove the Syslink on the file and remake the file to prevent DHCP from overwriting our changes.

First delete the resolv.conf file by running the following command:
rm -f /etc/resolv.conf

Next you need to make the file again:
vi /etc/resolv.conf

Press A to go into Insert mode.

Insert the following:


Press the Esc key to exit insert mode.

Press Shift and : simultaneously.

Type in wq and press Enter.

Restart the network service by using the following command.


service networking restart


service network restart

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Running Bash Commands in the Background the Right Way [Linux]

Running Bash Commands in the Background the Right Way [Linux]  Derrik Diener  31st Mar 2016...

Root SSH Login Disabled/Not Working?

On Ubuntu and Debian since Ubuntu version 12.04 root ssh login has been disabled by default the...

Accessing server - use ip or hostname?

Please use the ip address to connect, the hostname you see is only for easy identification by...

Powered by WHMCompleteSolution