• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setting DNS in Ubuntu
#1
As has been mentioned here on several occasions using Google's Open DNS servers is a much better solution than using the DNS server provided by your ISP.

This is how to change your DNS setting in Ubuntu to use said Google DNS server using gedit as a text editor(substitute your editor of choice where gedit is used):

In a terminal:

sudo gedit /etc/resolve.conf

In order to use the Google DNS you will need to add two entries into the file as such:

nameserver 8.8.8.8
nameserver 8.8.4.4

Save the file

Now the only problem is the next time you reboot or restart your networking interface(s) your DNS servers will be reset by the system to use the settings given by the DHCP server. Since this is counter-productive to the task at hand we will write-protect the resolve.conf file using the following command in terminal

sudo chattr +i /etc/resolv.conf

This gives your resolv.conf file an immutable file attribute preventing anything from modifying it.
In turn if you ever decide you would like to change DNS servers again remember to use the following command before attempting to edit the file again:

sudo chattr -i /etc/resolv.conf

:tux
[Image: icpn5k.jpg]
Trolls are the last thing you need to be concerned with.

VCD Wrote:// Forever more, count and reply, bitch.
  Reply


Messages In This Thread
Setting DNS in Ubuntu - by Pack3t SynAck3r - 14-09-2010, 05:44 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Setting a static or DHCP IP in Linux Mark 0 11,194 26-11-2010, 03:29 AM
Last Post: Mark

Forum Jump: