Skip to content Skip to sidebar Skip to footer

Get Ip Address Of Url In Python?

Possible Duplicate: How can I do DNS lookups in Python, including referring to /etc/hosts? Im using Python 2.7 and im creating a iptracer with an online API. And i want the user

Solution 1:

>>> import socket
>>> print socket.gethostbyname('google.com')
74.125.236.52

Solution 2:

You can use gethostbyname_ex() function located in socket module http://docs.python.org/library/socket.html


Post a Comment for "Get Ip Address Of Url In Python?"