title: IP address by Domain Name
body: <p>I am trying to get IP address of a domain..
  i am using following code</p>
  
  <pre><code>&gt;&gt; import socket
  &gt;&gt; socket.gethostbyname('www.google.com')
  </code></pre>
  
  <p>its giving me following error..</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;pyshell#18&gt;", line 1, in &lt;module&gt;
      socket.gethostbyname('www.google.com')
  gaierror: [Errno 11001] getaddrinfo failed
  </code></pre>
  
  <p>what is wrong with my code...is there any other way to get ip address by domain name in python..???
  please help...</p>