Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get hosting provider for IP with Python

Tags:

python

ip

hosting

I have a simple Python script that gets the IP for a domain and looks up the country using Maxmind. I would like that script to also get what webhosting company that hosts that IP/site. Is that possible, and if so how? I've searched this site and elsewhere without much luck.


1 Answers

>>> import socket
>>> socket.gethostbyaddr("69.59.196.211")

('stackoverflow.com', ['211.196.59.69.in-addr.arpa'], ['69.59.196.211'])

like image 71
dnlcrl Avatar answered Jan 01 '26 12:01

dnlcrl