Liberian Geek
  • Home
  • How-To/Tips
  • Linux
  • Windows

Setup Static DNS Servers in Ubuntu 12.04 (Precise Pangolin)

Sometimes you may want to use alternate DNS servers instead of the one provided by your ISP. This can be either public, private or secured DNS servers. For example, you may want to use Google Public DNS Servers or the one from OpenDNS to replace the one currently assigned to your system. Well, this brief tutorial is going to show you how to do that in Ubuntu 12.04 (Precise Pangolin). With the right DNS servers, you can browse faster, securely and protect your online data.

Objectives:

  • Add custom DNS servers in Ubuntu 12.04
  • Enjoy!

To get started, press Ctrl – Alt – T on your keyboard to open the terminal. When it opens, run the commands below to open dhclient.conf file.

sudo gedit /etc/dhcp/dhclient.conf

 

custom_dns_precise

 

Then change the line highlighted to:

prepend domain-name-servers x.x.x.x, y.y.y.y;

 

custom_dns_precise_1

Replace xx and yy with the primary and secondary DNS server addresses. Separate each address with a comma. Save the file and you’re done.

 

That’s it! Enjoy!

 

custom_dns_precise_2


Related Posts

  • Ubuntu 12.04.2 Released With Support For Systems Using UEFI Firmware With Secure Boot Enabled
  • LibreOffice 3.6.2 Maintenance Update Released
  • Blender 2.64 Released: Install it in Ubuntu 12.04 (Precise Pangolin)
  • Install / Upgrade to Linux Kernel 3.6.0 in Ubuntu 12.04 (Precise Pangolin)
  • OpenShot 1.4.3 Released: How To Install / Upgrade in Ubuntu 12.04

Home > How-To/Tips, Linux - 3 May 2012
Tweet
Got anything to say? Go ahead and leave a comment!
  1. Ton2lavega says:
    April 27, 2013 at 12:35 PM

    Hi,

    I had the same problem, and used your solution. It worked well, but my ISP’s DNS were still in resolv.conf. I wanted to make sure that I never used my ISP’s DNS, so I checked the dhclient.conf man page (http://linux.die.net/man/5/dhclient.conf) and found a solution :

    rather than the prefix “prepend”, I used the prefix “supersede” in the /etc/dhcp/dhclient.conf file :

    supersede domain-name-servers 8.8.8.8,8.8.4.4

    restat the network-manager and that’s it, now your DHCP-provided ISP DNS are not taken into account anymore.

    Hope that helps anyone looking for a solution to enforced static DNS in Ubuntu Server 12.04.

    Reply
Comment Below!
Click here to cancel reply.



Follow @liberiangeek

Recent Posts
    • How Do You Manage MySQL Databases In Ubuntu 13.04 Raring Ringtail
    • Say Yes To Google Play Music Manager In Ubuntu 13.04 Raring Ringtail
    • Delete Junk, Improve Performance And Increase Privacy With BleachBit In Ubuntu 13.04 Raring Ringtail
    • Firefox 21 Released For Windows, Mac And Linux Systems
    • How Can You Find System Information In Ubuntu 13.04 Raring Ringtail
    • Is There A Better Task Scheduler In Ubuntu 13.04 Raring Ringtail?
    • Want LAMP (Linux, Apache, MySQL, PHP) In Ubuntu 13.04?
    • Support For Ubuntu 10.04 / 11.10 Desktop And 8.04 Server Edition End Today
    • Want uTorrent In Ubuntu? You May Have To Settle For qBittorrent Instead
    • LibreOffice 4.0.3 Released–Third Minor Release Of LibreOffice 4.0 Family

    Copyright © 2009 - 2013 Liberian Geek        Privacy Policy |      About Us |      Contact Us |      Search

    ↑ Top