>>> import socket
>>> socket.gethostbyaddr("69.59.196.211")
('stackoverflow.com', ['211.196.59.69.in-addr.arpa'], ['69.59.196.211'])
For implementing the timeout on the function, this stackoverflow thread has answers on that.
More Related Contents:
- How to extract top-level domain name (TLD) from URL
- How can I use Python to get the system hostname?
- Python ‘requests’ library – define specific DNS?
- How can I do DNS lookups in Python, including referring to /etc/hosts?
- Tell urllib2 to use custom DNS
- Set specific DNS server using dns.resolver (pythondns)
- Tkinter: AttributeError: NoneType object has no attribute
- How do I get the full path of the current file’s directory?
- How to switch to new window in Selenium for Python?
- Iterate over all pairs of consecutive items in a list [duplicate]
- Detect image orientation angle based on text direction
- How can I do multiple substitutions using regex?
- Improve subplot size/spacing with many subplots in matplotlib
- How to put the legend outside the plot
- MySQL “incorrect string value” error when save unicode string in Django
- Possibilities for Python classes organized across files? [closed]
- What does “three dots” in Python mean when indexing what looks like a number?
- Mapping a global variable from a shared library with ctypes
- Convert list of strings to dictionary
- How to set up custom middleware in Django
- Boolean identity == True vs is True
- How to stop audio with playsound module?
- Is there a way to specify which pytest tests to run from a file?
- Effect of using sys.path.insert(0, path) and sys.path(append) when loading modules
- return value from one python script to another
- How to get the first word in the string
- Scrapy: ImportError: No module named items
- Add image annotations to bar plots
- How do I sum tuples in a list where the first value is the same?
- Iterate over a string 2 (or n) characters at a time in Python