In the process of upgrading to the latest Ubuntu 18 build, I am now stuck working in recovery terminal mode trying to reinstall GDM3 and ubuntu-desktop. problem is I can ping outside IP addresses, but cannot resolve names (ie. when running apt-get install it will not resolve us.archives.ubuntu.com) I have input 3 dns nameservers in my Wired Connection 1 file in NetworkManager. Rebooted and still cannot resolve names. THoughts?

  • Did you switch OFF the DNS AUTO setting in your Wired Connection? What are the contents of an unmodified /etc/resolv.conf? Are you running dnsmasq AND systemd-resolve?
    – heynnema
    Nov 27, 2018 at 15:01
  • @Joshua Mozdzier Let us know if you solved the problem. If yes how.
    – Vijay
    Nov 28, 2018 at 12:38
  • I dont understand your problem, are you talking about this ? youtube.com/watch?v=wjS4eBnR3q0
    – Andre
    Sep 20, 2022 at 20:23

1 Answer 1


This helped me in a similar situation.

As Official Ubuntu Documentation says:

If you require DNS for your temporary network configuration, you can add DNS server IP addresses in the file /etc/resolv.conf. In general, editing /etc/resolv.conf directly is not recommanded, but this is a temporary and non-persistent configuration.

This will only work for this session, and you can reinstall GDM3 and ubuntu-desktop. The file will be overwritten on reboot. So check the DNS settings after reboot in graphic mode.

On a terminal:

cat /etc/resolv.conf

If no DNS in there try:

echo "nameserver" | sudo tee /etc/resolv.conf

This worked for me in a situation like this.

If you want changes to persist see this.

  • 1
    /etc/resolv.conf should not be edited/modified manually. It says so right in the file itself. Whatever you manually place there will get overwritten.
    – heynnema
    Nov 27, 2018 at 15:05
  • @heynnema edited as suggested.
    – Vijay
    Nov 28, 2018 at 12:24
  • 1
    @heynnema it does not matter, as this answer solves the question exactly. While you are in recovery mode you get to use the Google DNS, then you can reboot and your temporary change gets correctly reverted. Nov 29, 2018 at 10:06
  • @AndreaLazzarotto it doesn't solve why the DNS problem in the first place. If you note my comment to the original question... which never got a reply... was that OP set DNS addresses in the GUI for Wired Connection, but probably forgot to set AUTO to OFF. Another possibility is that OP is runing dnsmasq and systemd-resolve at the same time... without editing a certain pref... and DNS probably won't work then either. I'd wager that after reinstalling gdm3 and ubuntu-desktop and rebooting, that the DNS problem still exists.
    – heynnema
    Nov 29, 2018 at 14:25
  • 1
    @heynnema I can relate on the fact that DNS almost never works in recovery mode (but it does while booting normally). This is probably due to the recovery mode being a stripped down boot that does not start all services. Hence a temporary fix might be exactly what is needed. Nov 29, 2018 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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