I'm connected to Wifi, yet I'm not?

I notice that happen sometimes when u r running protonvpn and u shutdown ur pc without closing protonvpn.
if that happen again to u:
1-open terminal and add the command:[if u have installed gedit text editor use it, if not use nano instead of gedit]
sudo gedit /etc/resolv.conf
2-u will append that line in it:
nameserver there is space between nameserver and ip,note u will replace that with ur primary dns, u can get it from connection info from icon of ur network or u can get it from by type nmcli in terminal to find DNS configuration:
servers: ip).
3-after save , the connection will work good, but if restart the computer, u will get the same problem again
4-to solve it permanently , u should open protonvpn again, that should solve the problem(to avoid that problem in the future, ensue to close protonvpn before restart or shutdown pc)
5-to ensure that is worked permanently, disconnect network and connect again