Hey there i was i am using Ubuntu 22.10 and its my first time using it. my WiFi seems to be workingfine and i wanted to install proton vpn and after using it for a while i disconnected and it seems to only work when i use protonvpn, But once i disconnect from my VPN and close it, and reset or restart my laptop. I can no longer access the internet. It connects to my wifi but no data. Then once i connect to the VPN again it works fine. can you explain why i cant get any data on the internet when i am NOT connected to my VPN?

I tried searching but can only get temporary solution using this command:

sudo sh -c "echo nameserver > /etc/resolv.conf"

If any one has faced this problem before please do share your solution, and if possible a fixed and constant solution.

Thanks in advance!!!

  • You are probably using the VPN providers DNS. Your temp solution points to that as the issue.
    – David
    Commented Apr 8, 2023 at 18:29
  • additionally my nordvpn has a killswitch option, sometimes I have to turn it off to get the internet connection to login to it than connect to vpn.
    – pierrely
    Commented Apr 9, 2023 at 1:42
  • How did you install ProtonVPN? Which ProtonVPN app are you using? There are instructions on their website; can you provide a link to that which you followed? How are you connecting/disconnecting to the VPN? Can you show screenshots? Do you have the Permanent Kill Switch engaged in the app? Please update your question with this information.
    – mpboden
    Commented Jul 4, 2023 at 15:28

2 Answers 2


Try editing your sudo nano /etc/resolvconf/resolv.conf.d/head nameserver to your desired dns server. then check if the changes were made using cat /etc/resolv.conf


Another solution is to use sudo iptables -F. Normally a vpn app with network lock will modify your iptables which should be able to be reset by issuing the command I put above which will flush out any rules.

Normally when you close the vpn app it will do this for you but if you killed or exited the app abnormally, the iptables rules will stay, blocking any network access.

You must log in to answer this question.

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