you could be using a VPN which - possibly - do not restore system DNS upon disconnect.
You can find soem basic help with [root tip] [How To] Basic network know-how and troubleshooting
If you issue is VPN related you may need to look at your resolver - switching from openresolv to systemd-resolved work for NordVPN.