title: urllib.urlopen() gives socket error: Name or service not known on python2.7
body: <p>I am just starting to use and learn Python, so this may seem vary naive to ask. 
  On my Linux system if i try to get a webpage using <code>urllib.urlopen()</code> I get an error</p>
  
  <pre><code>Traceback (most recent call last):  
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;  
    File "/usr/lib/python2.7/urllib.py", line 86, in urlopen  
      return opener.open(url)  
    File "/usr/lib/python2.7/urllib.py", line 207, in open  
      return getattr(self, name)(url)  
    File "/usr/lib/python2.7/urllib.py", line 344, in open_http  
      h.endheaders(data)  
    File "/usr/lib/python2.7/httplib.py", line 954, in endheaders  
      self._send_output(message_body)  
    File "/usr/lib/python2.7/httplib.py", line 814, in _send_output  
      self.send(msg)  
    File "/usr/lib/python2.7/httplib.py", line 776, in send
      self.connect()   
    File "/usr/lib/python2.7/httplib.py", line 757, in connect  
      self.timeout, self.source_address)  
    File "/usr/lib/python2.7/socket.py", line 553, in create_connection  
      for res in getaddrinfo(host, port, 0, SOCK_STREAM):  
  IOError: [Errno socket error] [Errno -2] Name or service not known  
  &gt;&gt;&gt;   
  </code></pre>
  
  <p>If I try to do the same in the Python 2.7 installed in my Windows 7 system, it works fine.<br>
  Since i am a novice, its difficult for me to diagnose the problem. I tried to research it but still haven't got any answers.</p>
  
  <p>So my questions are:  </p>
  
  <ol>
  <li>What is different in the windows system that <code>urlopen()</code> works there but not on Linux.  </li>
  <li>What needs to be done to ensure that <code>urlopen()</code> works on the Linux system. Its necessary   for me that it works since the the program I am developing has some bash   command calls and the program depends extensively on the proper working of <code>urllib</code>.  </li>
  </ol>