Python 3 Find IP Address of Domain Name Using Socket Module

code.py

import socket
 
hostname = input("Please enter website address:\n")
 
# IP lookup from hostname
print(f'The {hostname} IP Address is {socket.gethostbyname(hostname)}')

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.