I am trying to get IP address of a domain.. i am using following code
>> import socket
>> socket.gethostbyname('www.google.com')
its giving me following error..
Traceback (most recent call last):
File "<pyshell#18>", line 1, in <module>
socket.gethostbyname('www.google.com')
gaierror: [Errno 11001] getaddrinfo failed
What is wrong with my code...is there any method in Python to acquire an IP address from a domain name?