In order, to fix that problem, I recommend you to do the following:
Open CMD as administrator then run the below commands, restart your PC after running the commands. Press HERE for a video tutorial
ipconfig /flushdns
nbtstat –r
netsh int ip reset
netsh winsock reset
If the above commands don't work make sure you don't have any antivirus which might block the connection such as Kaspersky.