Ubuntu 20.04 temporary failure in name resolution for wired

19,973

Solution 1

It's likely your default DNS server is pointing to an IP address that is not capable of resolving DNS queries. You should check the DNS settings in the file that /etc/resolv.conf is pointing to. When you go to that file (/var/run/systemd/resolve/resolve.conf), look at the IP that is right next to the keyword namespace. You should set it to your router's IP address (which can be found with the command route -n. Look for the gateway column and take the one that's not 0.0.0.0) or you can also set it to a public DNS server such as 1.1.1.1, 8.8.8.8 etc.

EDIT: Please follow these instructions:

Execute sudo rm /etc/resolv.conf

Execute sudo touch /etc/resolv.conf

Edit the file with sudo nano /etc/resolv.conf

Add this line to the file: nameserver 1.1.1.1

Press ctrl + s to save and ctrl + x to exit

Then try to access the internet again. If it still doesn't work, reboot the system and try again. That should solve your problem.

Solution 2

Firstly, I have to give a shout out to @chili555 for spending literally hours last night helping me troubleshoot.

After many hours of troubleshooting, the simplest answer was the solution. Something must have gone wrong during installation, because after a reinstall from the same usb flash drive, my computer is on the network and accessing the internet.

I still don't know the true cause, but my server is up and running.

Thanks @chili555!

Share:
19,973

Related videos on Youtube

Zedd
Author by

Zedd

Updated on September 18, 2022

Comments

  • Zedd
    Zedd over 1 year

    I am getting the following error from ubuntu 20.04 terminal, connected via wired ethernet connection: When I type the following command which I am using in a bash script:

    ping -c 1 google.com

    for a health check to ensure it has access, I get the following error:

    ping: google.com: Temporary failure in name resolution

    Some background

    I overwrote my older gaming rig to be a ubuntu multi purpose server (including smart home automation) in my home network. It used to be windows 10, but I formatted the drive and installed ubuntu on it.

    I have not yet been able to access the internet with ubuntu, however, I do know that the equipment works because I left the internet wired in, I actually downloaded ubuntu via that machine onto the usb before installing.

    Now I cannot see or connect to the ubuntu server from other devices and cannot reach the internet to download even basic tools like netstat.

    At this point, I feel like I've bashed my head against a wall and scoured the internet (and lots of other stack overflow threads) and tried a bunch of things that didn't work.

    Any help would be greatly appreciated!

    Edit: As requested in comments, I am attaching a screenshot, since I am not able access the computer via any network. Only via hdmi.

    enter image description here

    Edit 2: Second screenshot as requested.

    enter image description here

    • Admin
      Admin over 2 years
      Pease edit your question to show the result of these terminal commands: ip addr show and also: cat /etc/netplan/*.yaml
    • Admin
      Admin over 2 years
      I don't have access to it, so i took a pic with my phone and just commented out some personal naming stuff
    • Admin
      Admin over 2 years
      One more, please: ls -al /etc/resolv.conf Thanks.
    • Admin
      Admin over 2 years
      Ty for taking the time to help me! :-)
    • Admin
      Admin over 2 years
      Is IPv6 enabled in Network Manager? Is this a static IP address you set in Network Manager? Is the reult the same if you do: ping4 -c1 www.google.com So far, everything looks fine.
    • Admin
      Admin over 2 years
      yeah, same error if i do that command. I didn't explicitly set it.. this is the vanila ubuntu 20.04 i downloaded today from the website.. didn't do anything other than try to get the network to even do a simple apt-get update lol
    • Admin
      Admin over 2 years
  • chili555
    chili555 over 2 years
    "cat: /var/run/systemd/resolve/resolve.conf: No such file or directory"
  • Zedd
    Zedd over 2 years
    impossible to do what you are asking since the commands you are asking me to execute are not installed and i have no internet access.
  • Muhammed Özen
    Muhammed Özen over 2 years
    route and nano are basic commands that are in every linux distributions. I guess I understand the problem now. If you're getting this error "cat: /var/run/systemd/resolve/resolve.conf: No such file or directory", then it means you dont have any DNS server configured for your OS at all. The file that is supposed to contain DNS settings is not even present. We can fix this if you follow my instructions. I'll include them in my answer in just a little bit since I have character limitation here. Check out the answer please.
  • Muhammed Özen
    Muhammed Özen over 2 years
    I just saw your answer. I didnt know you'd solved the problem. Awsome work. But the problem was you didnt have and DNS config file. If you run into any problem like that again, you can try the steps I explained above
  • Zedd
    Zedd over 2 years
    Thank you so much Muahammed! yeah it was weird, it didn't even have ifconfig installed, let alone route lol And I can't take credit for the awesome work, it was all @chili555
  • Muhammed Özen
    Muhammed Özen over 2 years
    You're welcome Zedd. Wow that must have been tough. I'm glad you solved it. Then thanks are for @chili555
  • chili555
    chili555 over 2 years
    Awesome! Glad it's working as expected.
  • Stephen Punwasi
    Stephen Punwasi over 2 years
    Good temporary fix to update packages in an emergency, but it gets overwritten by the system eventually. But definitely a quick fix to get updates and packages installed to resolve the issue.