Last updated 3 months ago
In Python, we can get IP Address for a hostname by using gethostbyname function from socket module, which is in built in Python.
gethostbyname
socket
Source:
>>> import socket >>> socket.gethostbyname("www.google.com") '172.217.166.4'