Configure DNS Name Server in Linux

To change existing name server IP address or to configure DNS name server IP address under Ubuntu Linux/Debian Linux, to configure DNS name resolution under Ubuntu Linux, you need to edit /etc/resolv.conf file under Debian/Ubuntu Linux to set Name server IP address that the resolver should query. Up to 3 name server internet IP address can be defined. If there are multiple servers, the resolver library queries them in the order listed.

To edit the dns address, type the following command, enter:
$ sudo vi /etc/resolv.conf


Or You can use gedit/nano text editor as follows:
$ sudo nano /etc/resolv.conf

Now enter your desired name server address as follows:

Now save the above and restart the network as follows:
$ sudo /etc/init.d/networking restart

Thats it.

Add a Comment

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