Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am very new to Ubuntu :)

I recently installed Ubuntu Desktop 12.04 - My system detected (correctly) that I am resident of the United Kingdom and so it/I set my update server to the United Kingdom server.

However, this was not a good choice for the following reason:

According to the UK update server my system requires some 270 updates. However, when I try to install them I receive the message that "these updates would be from unauthenticated sources" and then refuses to install any updates.

I did some reading and found that it is recommended I use the "Main" server for updates, so I changed to "Main" and ran the update process again, only to find that my system is FULLY up to date and there are ZERO outstanding updates to apply to my system.

OK .. so that solved something which really should not be a problem in the first place. It would be nice to see the UK update server bought "up to date". (Some technical irony here, for those who noticed)

So, I moved on to my next task ..

However, since changing to the "Main" server for updates my system is no longer respecting my DNS setting and so I can not continue.

My DNS setting is set to a local (intranet DNS server) located on my local subnet (ie in this case), however, when I try to run the update process (or any sudo apt-get process) my system starts trying to connect to DNS servers outside of my LAN.

Due to technical policies, I have been given temporary egress to these external DNS servers.

What I would like to know is:

Is it possible to force all Ubuntu DNS requests to respect the DNS server configured by my network settings.
IE. All DNS requests go to my LAN DNS server at


share|improve this question
up vote 0 down vote accepted

Try this for updated server:

enter image description here

enter image description here

enter image description here

As far as forcing DNS, try this:

You can edit your /etc/dhcp3/dhclient.conf, and add the DNS servers to the "prepend" line; this will ensure that the DNS servers are used everytime.

Open terminal. Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo gedit /etc/dhcp3/dhclient.conf

Change this:

#prepend domain-name-servers; and change it to read

To this:

prepend domain-name-servers  yyy.yyy.yyy.yyy 

Replace the XXX, and YYY to reflect the DNS servers you want.

To test, you can either restart, or logout, and log back in, or just give the command

sudo /etc/init.d/networking restart

You can also set dns-* options in your interfaces file, to use the DNS of choice.

share|improve this answer
To be honest i have given up with the destop version of ubuntu – Asta-Risky Sep 17 '13 at 21:09
Why? What's wrong? Is something still not working? – Mitch Sep 18 '13 at 5:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.