How to fix Ubuntu DNS problems

Find an article
Nov 15
Published by in · Leave your thoughts
( words)
Warning! There was an error loading some of the images for this post.

If you’re experiencing DNS related problems on Ubuntu, follow the below steps to use Google’s public DNS servers:

  1. Open network interfaces:
    sudo vim /etc/network/interfaces
  2. Add the following after “# dns-* options are implemented by the resolvconf package, if installed“:
    dns-nameservers 8.8.8.8 8.8.4.4
  3. Restart the networking service:
    sudo /etc/init.d/networking restart

You should then be able to ping google.com and continue with what you were originally doing. If you experience further problems when using apt-get you will need to clear your cache:

  1. Delete apt cache:
    sudo rm -rf /var/lib/apt/lists/*
  2. Re-download packages:
    sudo apt-get update

Leave a Reply

Your email address will not be published.