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?
Asked
Active
Viewed 4,412 times
1
-
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 '18 at 15:01
-
@Joshua Mozdzier Let us know if you solved the problem. If yes how. – Vijay Nov 28 '18 at 12:38
-
I dont understand your problem, are you talking about this ? https://www.youtube.com/watch?v=wjS4eBnR3q0 – Andre Sep 20 '22 at 20:23
1 Answers
4
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 1.1.1.1" | sudo tee /etc/resolv.conf
This worked for me in a situation like this.
If you want changes to persist see this.

Pablo Bianchi
- 15,657

Vijay
- 8,056
-
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 '18 at 15:05
-
-
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. – Andrea Lazzarotto Nov 29 '18 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 '18 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. – Andrea Lazzarotto Nov 29 '18 at 16:49
-
@AndreaLazzarotto we won't know... unless the OP ever responds... whether their DNS problem also existed when booting normally... it sounds like they did have a problem there too... hence my comments/questions. Maybe the temp fix was all OP needed. – heynnema Nov 29 '18 at 18:10
-
My friend just had a problem with connection in recovery mode and this answer helped me fix it. – int_ua May 15 '20 at 09:28