Fixing intermittent DNS problems on Ubuntu 12.04

October 7th, 2012 at 3:59 pm

I’ve been having some intermittent DNS resolution failures on my recent installation of Ubuntu 12.04. Googling showed that I’m not the only one, and the solution found here seems to be working for me:

sudo vi /etc/NetworkManager/NetworkManager.conf

Then comment out (by prepending a #) the line dns=dnsmasq. Finally:

sudo restart network-manager

Related posts:

  1. Some problems installing Ubuntu 10.04 on VirtualBox
  2. Installing Python 2.7 on Ubuntu
  3. Hello from Ubuntu Linux 7.04
  4. Upgdated Ubuntu on my laptop to 12.04
  5. problems with recent changes of use.perl !

5 Responses to “Fixing intermittent DNS problems on Ubuntu 12.04”

  1. sunileshNo Gravatar Says:

    hi, sorry for this, but am a complete novice at ubuntu/linux, and have no idea what you mean by ‘comment out’ and how to do it… appreciate the help.

  2. elibenNo Gravatar Says:


    By “comment-out” in this particular file I mean add a hash symbol – ‘#’ in the beginning. So instead of:


    You should have:


    Alternatively, you can just delete the whole line.

  3. Jochen L. LeidnerNo Gravatar Says:


    Thanks for this – works like a breeze!


  4. OmnicommentNo Gravatar Says:

    Thanks! This seems to be working. (Although, I’ll have to give it a few hours of continuous internet usage with no outages, to confirm)

    Just a tip. You can edit the NetworkManager.conf file using the default GUI text-editor too. Modify the first line with

    sudo gedit /etc/NetworkManager/NetworkManager.conf

  5. oldschoolNo Gravatar Says:

    Thank you!! Seriously!

Leave a Reply

To post code with preserved formatting, enclose it in `backticks` (even multiple lines)