Windows automatically stores the IP addresses of the websites you visit, so they open faster the next time you visit them. But if this cache becomes outdated or corrupt, it can stop you from accessing the internet altogether. To see if this is what’s causing your problem, simply renew and flush the DNS:
1) Press Windows+R on your keyboard.
2) Type cmd then press Ctrl+Shift+Enter to open an administrator Command Prompt. (Don’t just press Enter or click OK as that won’t open the command prompt in administrator mode.)
3) Type ipconfig /flushdns and press Enter on your keyboard.
4)Type ipconfig /renew and press Enter on your keyboard.
5)Type ipconfig /registerdns and press Enter on your keyboard.
6) Reboot your PC and see if the problem is resolved.