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


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

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

    ping -c4

    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 This uses the Google DNS servers at

  • 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
    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
    Oct 22, 2020 at 14:55
  • I wrote query here.
    – michal
    Oct 22, 2020 at 15:09

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.

  • 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
    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.:-( Aug 5, 2020 at 13:14
  • Restart does not help on VMware Fusion Player 13.5, Ubuntu 22.04 :-(
    – Tom
    Nov 5 at 12:32

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


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 .