Hey Buddy
I was also facing this error recently. And While searching about it found a solution which you can also use. It worked for me.
Go to Command Prompt by pressing windows key and X and select Command Prompt.
Now, just paste these commands one by one and after every command hit enter.
Commands: ipconfig /release
ipconfig /all
ipconfig /flushDNS
ipconfig /renew
netsh int ip set DNS
netsh winsock reset
Lastly, just reset your PC or the device and see if it makes any changes.