Ubuntu – DNS not working in recovery terminal mode

data-recoverydns

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?

Best Answer

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.

CMD:

cat /etc/resolv.conf

If no DNS in there try:

echo "nameserver 8.8.8.8" >/etc/resolv.conf

This worked for me in a situation like this.

If you want changes to persist see this.

Related Question