In PHP, to get the ip
of a given domain, I usually use the gethostbyname
function.
PHP example:
gethostbyname('www.google.com'); //201.17.165.210
What about Python? How can I do this?
In PHP, to get the ip
of a given domain, I usually use the gethostbyname
function.
PHP example:
gethostbyname('www.google.com'); //201.17.165.210
What about Python? How can I do this?
Actually in python it's almost that:
import socket
socket.gethostbyname('www.google.com') # 216.58.211.196