14

I've installed Kubuntu 18.04 on a desktop with an ethernet connection. During the installation, updates were downloaded and the internet was working fine. Once the operating system is installed, every time I try to ping any website I get the following error:

Temporary failure in name resolution

I've tried the ethernet cable on different computers and it works, so I don't know what I should do next.

4 Answers 4

16

There are different possible reasons for a failure in name resolution.

  1. You don't have any internet connectivity. Try

    ping -c4 8.8.8.8
    

    If you get answers, then your internet connection works. Else find out why it doesn't

  2. You have the wrong resolver. Type

    cat /etc/resolv.conf
    

    You should see at least one line

    nameserver a.b.c.d
    

    The a.b.c.d is typically the address of your router. If there is no such line, add one. If there is such a line, but it doesn't work, of if you don't know the address of your router, try nameserver 8.8.8.8. This uses the Google DNS servers at 8.8.8.8.

3
  • 1
    It's work, but when I disconnected VPN and next connected to VPN, then inside file /etc/resolv.conf disappear nameserver a.b.c.d and I must add nameserver again
    – michal
    Commented Oct 22, 2020 at 14:52
  • Then your distribution has some mechanism that changes the file, and does it wrong. As this is only marginally related to this question, you should create a new question with more information about your system.
    – RalfFriedl
    Commented Oct 22, 2020 at 14:55
  • I wrote query here.
    – michal
    Commented Oct 22, 2020 at 15:09
4

If you are using VMWARE running linux vm on windows, my experience maybe helpful:

systemctl restart NetworkManager.service

It happens when you havn't shut down your vm correctly.

3
  • Same set up here, but oddly I had to restart my VM entirely. After restarting networking I could ping hosts and see them resolving properly, but still had resolution errors in tomcat. Didn't spend any more time trying to track down exactly what was going on.
    – Windle
    Commented Aug 3, 2020 at 13:32
  • Hi, I ran ifconfig in linux and found no Ethernet, then restart the networking service resolve it. As you could ping hosts, I thought it should be Tomcat troubles..Sorry I am not sure about Tomcat.:-( Commented Aug 5, 2020 at 13:14
  • Restart does not help on VMware Fusion Player 13.5, Ubuntu 22.04 :-(
    – Tom
    Commented Nov 5, 2023 at 12:32
1

I solve the problem changing the dns setting in my router and set the google dsn 8.8.8.8, this works for me.

0

Short Answer:

A misconfigured NAT rule in the Internet GW caused this error in my case, NOT a misconfiguration on the Linux host itself. Check for misconfigured or missing NAT rules in your Internet GW router!

Longer Answer:

I checked, double checked & triple checked all my local networking on the Linux host. I did comparative analysis with other Linux hosts in the same cohort; everything was the same. So why was this host's DNS now broken?

The answer was found in front of the host on my Internet gateway firewall. I had re-addressed several hosts (I know, never a good thingy ;->), but missed updating the NAT rule for this particular one in the Firewall. It was nothing at all to do with a misconfiguration on the Linux host itself.

But I got so blinkered about that DNS error message that I just assumed it was a misconfiguration of DNS on the host rather than on the firewall. Once I fixed the NAT rule, normal DNS resolution was restored. D'Oh!

So be aware that an incorrect or missing NAT rule for the affected host in your router can cause this error. HTH-

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .