I had this problem when i was using my university internet. But only there. What I did to solve the problem was use a different DNS server. You will need to edit /etc/resolv.conf and add a line "nameserver 4.2.2.2"
Thats the one I use. I am not sure what OS you are using, but generally speaking you can this from a terminal window:
Code:
sudo <texteditorhere> /etc/resolv.conf
Hope this helps