Wednesday, December 1, 2021

Get IP address from domain name

 Given a domain name like "", the python script below will return its server IP address like this "".

import socket
import pandas as pd

websites_df = pd.read_html('')

for d in websites_df[0]['Domain Name']:
    IP_addres = socket.gethostbyname(d)
    print(d, ' - ', IP_addres)

That is it!

No comments:

Post a Comment