Finally I stumbled on to a solution for the problem and it was this. I needed to open up an elevated CMD shell and enter the following:
netsh winsock reset catalog
Winsock (an abbreviation for Windows Sockets API) controls how Windows network software should access network services. In short, it was broken so I reset it. Good to know if it happens again in the future.