Windows 10 has been polished by Microsoft to provide as seamless an experience an OS can, but it still has its fair share of bugs and glitches here and there.
One such error while trying to access the internet is when Windows can’t communicate with a device or resource and here are seven ways to fix the problem.
Restart your router
The first thing that should be on your network troubleshooting list is restarting the router. Restarting your networking devices can fix a lot of seemingly random issues which involve your devices not being able to connect to the network or to the internet.
Also read: How to fix the ‘Windows 10 taskbar not hiding in fullscreen’ issue?
Update your drivers
Out of date drivers for your network card can cause this issue. Here’s how you can update them.
Step 1: Press Windows key + R, type in devmgmt.msc and hit enter.

Step 2: Double click Network adaptors to expand it and right click your Wi-Fi card. Click on Update driver.

Step 3: Select Search automatically for drivers and Windows will find and install any available updates.

Clear the DNS cache
Just like every other cache, any corrupted settings in your DNS cache can cause this issue. Here’s how you can clear it out.
Step 1: Press Windows key + R, type cmd and hit the Enter key.

Step 2: Type in ipconfig /flushdns and hit enter. This will reset your DNS settings to their defaults.

If this doesn’t work, you can go ahead and reset files used by Windows to access the internet by using these commands.
ipconfig /flushdns
ipconfig /registerdns
ipconfig /release
ipconfig /renew
Also read: How to uninstall programs using Command Prompt on Windows 10?
Resetting TCP/IP
One of the reasons you might be experiencing this issue is because your TCP/IP stack may be corrupted. There’s a tool for this from Microsoft but the download link on Microsoft’s page is broken at the time of writing so we’re just going to do it from the Command Prompt.
Step 1: Open Command Prompt with admin privileges by pressing Windows Key + X and clicking on Command Prompt(admin).

Step 2: Type in the following command and press enter.
netsh int ip reset

Restart your PC and try again.
Check your adaptor settings
Sometimes you need custom adaptor settings to connect to a network that might have certain specific rules such as a school or a work network. But in case these settings stay, you will not be able to connect to the internet anywhere else.
Here are the steps you need to follow.
Step 1: Press Windows key + I to open the Windows settings.

Step 2: Click on Network & Internet.

Step 3: Click on Change adaptor options.

Step 4: Right-click on your Wi-Fi network and click Properties.

Step 5: Find Internet Protocol Version 4 in the list, click on it and then click Properties.

Step 6: Make sure that all settings are set to automatic.

Step 7: Now repeat steps 5 and 6 with Internet Protocol Version 6.
In case this doesn’t work, you can try moving to a public DNS using the guide below.
Try a public DNS
If automatic DNS settings aren’t working out for you, try moving to a public DNS. Follow these steps.
First five screenshots are the same as Check your adaptor settings. Also remove the last line from that very section after adding this)
Step 1: Press Windows key + I to open the Windows settings.

Step 2: Click on Network & Internet.

Step 3: Click on Change adaptor options.

Step 4: Right-click on your Wi-Fi network and click Properties.

Step 5: Find Internet Protocol Version 4 in the list, click on it and then click Properties.

Step 6: Click on Use the following DNS server addresses.

Step 7: Type in 8.8.8.8 in the Primary DNS field and 8.8.4.4 in the Alternate DNS field.

Edit the hosts file
If you’ve followed every step so far in this article, your host file has already been regenerated, but it doesn’t hurt to take another look.
Step 1: Open up Windows Explorer and head over to the following path
Windows (C:) > Windows > System32 > drivers > etc

Step 2: You’ll see a file named hosts. Right-click on the file and open it with notepad using the Open with option.

Step 3: Select everything in the file and clear it out. Make sure to save before closing the file.

Also read: How to fix the ‘Google Chrome sound not working’ error in Windows 10?