Whenever I face a problem like this, I try to narrow it down to a certain layer of the OSI model as quickly as possible.
Is DNS resolution working? Yes, so we have an IP address to connect to.
Can I ping that address, or is there a network connectivity problem?
Am I able to establish a TCP connection to that address/port using telnet?