this is ugly hack:
You aren't always connected to the network (i.e. cable unplugged).
Google DNS BGP segment could be unreachable.
You may have no route for their network at all, i.e. private network segment not connected to the internet.
There could be no UP interfaces at the moment (except lo).
Have you tested the exception types you'll get from s.connect for all above?