Python 3 Find IP Address of Domain Name Using Socket Module

0Shares

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)}')
0Shares

Leave a Comment

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