Since a wifi outage a day or so ago I have had no access to the internet on my ubuntu running computer. I can ping, so I believe the problem is DNS related. However, manually setting the DNS in the network manager does nothing. I have also tried systemctl enable resolved, but am told that I don't have a resolved.service file at all.

Any ideas that people have on how to fix this issue would be greatly appreciated, as I am increasingly out of ideas. I can provide more information on request.

Edit: The input cat /etc/resolv.conf returns No such file or directory Edit 2: After following the advice of a previous answer, cat /etc/resolv.conf now gives:

This file is managed by man:systemd-resolved(8) Do not edit.

And other such information about the file. However, I still cannot access the internet. Edit 3: Putting in cat /etc/resolv.conf gives the nameserver and options ends0 trust-ad lines, but not the search example.com one.

Additonally, entering in /etc/reslov.conf gives bash: /etc/resolv.conf: Permission denied if that is of any use to anybody.

Edit 4: Somehow, someway, for reasons known but to God, cat /etc/resolv.conf is again telling me there is no such file. I did restart the computer a moment ago to see if that would set things right. Clearly, it did not. Putting in sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf returns Unable to resolve host (my name)'s computer: Temporary failure in name resolution followed by (after a password entry) ln: failed to create smbolic link etc/resolv.conf: No such file or directory

Edit 5: Upon creating that text file nameserver and trying to save it as * etc/resolv.conf* I am told that there is an error for every place I would try to save it in, as there is "No such file or directory."

This is entirely new and doesn't happen when I save a quickly drawn-up word document.

Edit 6: An error upon trying to save the new file they are as follows:

(gedit: 3844): Tepl-WARNING ** (timestamp): GVfs metadata is not supported fallback to TeplMetadataManager. Either GVfs is not correctly installed or GVfs metadta are not supported on this platform. In the later case, you should configure Tepl with --disable-gvfs-metadata

The second:

(gedit: 3998) WARNING ** (timestamp): Hit unhandled case 11 (error opening file "/etc/resolv.conf": too many levels of symbolic links) in parse_error


(geditt:3998) CRITICAL ** (timestamp) _gedit_tab_save_as_async: assertion'tab-> state == GEDIT_TAB_STATE_NORMAL || tab->state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION || tab-> state == GEDT_TAB_STATE_SHOWING_PRINT_PREVIEW' failed

Additonally, when trying to open the old /etc/resolv.conf I am told it cannot be opened because "its target "/run/system/resolve/stub-resolv.conf" doesn't exist"

Edit 7: rm /etc/resolv.conf produces rm: cannot remove '/etc/resolv.conf': permission denied

I also cannot just drag it to the trash or delete it in other known ways.

I am beginning to wonder if reinstalling ubuntu entirely would be easier at this point.

Final Edit:

It works! The problem seems to have been some odd final remnant of my old VPN. Upon removing it and restarting the machine the problem vanished. While I am still concerned about things like how the computer cannot find /etc/resolv.conf when I order it to destroy the file, I can cross that bridge later.

I would like to thank everyone who helped me with this, as I know you all have other things to do. I hope that someday I understand this stuff well enough to pay it forward.

  • Do other devices on your LAN also have similar problems? Or do they all resolve properly?
    – user535733
    Aug 31, 2021 at 16:39
  • Everything else works perfectly, I am even able to connect to a local printer using my computer. I just can't do much else. Aug 31, 2021 at 16:49
  • 1
    What does the command cat /etc/resolv.conf show? Please edit your question and add the output.
    – raj
    Aug 31, 2021 at 16:51
  • After nameserver line is in the /etc/resolv.conf file, and you restart systemd-resolved, is the DNS resolution working?
    – raj
    Aug 31, 2021 at 19:03
  • Looks like something that runs on system startup is deleting /etc/resolv.conf. I don't know why. Maybe it's something left over from the Proton VPN software, that wasn't properly uninstalled. Not being able to check all the startup files on your computer, I can't tell what it is. Last test: try to manually create a file /etc/resolv.conf (with editor), containing only the single line: nameserver See if this will work.
    – raj
    Aug 31, 2021 at 19:21

2 Answers 2


Hey there I also faced the same after uninstalling protonvpn . basically what it does is that it leaves the network settings of ProtonVPN killswitch just the same even after uninstalling the vpn, according to this post.

See this page for the solution.

Disable the kill switch if you have uninstalled the app

The kill switch can be easily disabled from within the official Linux CLI app, but this will not be possible if you have uninstalled the CLI app first without disabling the kill switch. This may result in your system being unable to access the internet. To remove the kill switch after the CLI app has been uninstalled:

  • Identify ProtonVPN connection names by running the command:

    nmcli connection show --active

This will display a list of all your system’s active connections.

  • Look for any connections with the pvpn- prefix. This usually includes pvpn-killswitch and pvpn-ipv6leak-protection, and may include pvpn-routed-killswitch. Delete all these connections using the following command:

    nmcli connection delete [connection name]

    For example:

    nmcli connection delete pvpn-killswitch
  • Re-run the following command to verify that ProtonVPN connections have been deleted:

    nmcli connection show --active

If any ProtonVPN connections remain, delete them as described above.


Without /etc/resolv.conf file, the DNS resolution will not work. It's quite strange why the file got deleted. Did you use any VPN software?

Type the command systemctl status systemd-resolved (the service name is systemd-resolved, not resolved alone) to see if the service is running. If the service does not run, try to start/enable it (systemctl start systemd-resolved/systemctl enable systemd-resolved). If it is running, and /etc/resolv.conf still doesn't exist, do the following:

sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

This should re-create your /etc/resolv.conf and the DNS resolution should start working.

Update: Your /etc/resolv.conf should contain - apart from some comments with information about the file - the following important lines at the bottom:

options edns0 trust-ad
search example.com

where example.com should be replaced by your local domain (for example the one of your ISP).

If after linking /etc/resolv.conf to /run/systemd/resolve/stub-resolv.conf the above lines are not present in the file, try first disconnecting and re-connecting your network connection. If this doesn't fix the situation (the lines still don't appear), try restarting systemd-resolved. If still no effect, try linking /etc/resolv.conf to fallback static configuration file /usr/lib/systemd/resolv.conf:

sudo rm /etc/resolv.conf
sudo ln -s /usr/lib/systemd/resolv.conf /etc/resolv.conf

The file will not contain the "search" line, but should contain the two other ones.

If these lines are still not present, try to add them manually using a text editor (sudo gedit /etc/resolv.conf). Restart systemd-resolved after making the change.

  • Hello, Thank you for your answer, I did have a VPN (proton) which I uninstalled not too long ago. I suppose I was unaware of how it might interact with anything else- I am still new to Ubuntu and am learning all of that sort of thing. The service was running, so I put in your code and was able to recreate the /etc/resolv.conf, but this does not seem to have fully fixed the situation. I'll add the other changes to the output in the above post. Aug 31, 2021 at 18:18
  • @Hendricks37 So try another option. See the updated answer.
    – raj
    Aug 31, 2021 at 18:47

You must log in to answer this question.

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