title: urrlib2.urlopen: "Name or service not known" persists when starting script without internet connection
body: <p>I have this simple minimal 'working' example below that opens a connection to google every two seconds. When I run this script when I have a working internet connection, I get the Success message, and when I then disconnect, I get the Fail message and when I reconnect again I get the Success again. So far, so good.</p>
  
  <p>However, when I start the script when the internet is disconnected, I get the Fail messages, and when I connect later, I never get the Success message. I keep getting the error:</p>
  
  <blockquote>
    <p>urlopen error [Errno -2] Name or service not known</p>
  </blockquote>
  
  <p>What is going on?</p>
  
  <pre class="lang-python prettyprint-override"><code>import urllib2, time
  
  while True:
      try:
          print('Trying')
          response = urllib2.urlopen('http://www.google.com')
          print('Success')
          time.sleep(2)
      except Exception, e:
          print('Fail ' + str(e))
          time.sleep(2)
  </code></pre>