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:

nameserver 8.8.8.8
nameserver 8.8.4.4

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.

Ubuntu:

service networking restart

Centos:

service network restart

Was this answer helpful?

 Print this Article

Also Read

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...

Accessing server - use ip or hostname?

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

Root SSH Login Disabled/Not Working?

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

Powered by WHMCompleteSolution