Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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'm trying to reinstall grub on a second disk, following the instructions at Purge & Reinstall Grub.

After doing sudo chroot /mnt, when I attempt apt-get update, I get lot of failed to fetch messages. Apparently DNS is not working, since running the host command on any hostname times out: no servers could be reached.

If I exit the chroot, host and apt-get update work just fine.

share|improve this question

According to your description your chrooted environment has no information about valid nameservers (DNS). You can copy the file /etc/resolv.conf into the etc directory of your chroot environment. You could also edit the file /mnt/etc/resolv.conf (or if you are inside the chroot in /etc/resolv.conf) and add the line


This uses a nameserver from Google.

When your system has valid information about DNS servers it will work again as expected.

share|improve this answer

Inside the chroot, edit /etc/resolv.conf (nano /etc/resolv.conf) and insert the following line:


Name resolution should work now.

PS: Press Ctrl+O,Enter to save the file in nano and Ctrl+X to exit.

share|improve this answer

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.