4
In PHP, to get the ip
of a given domain, I usually use the function gethostbyname
.
PHP example:
gethostbyname('www.google.com'); //201.17.165.210
And in Python? How can I do this?
4
In PHP, to get the ip
of a given domain, I usually use the function gethostbyname
.
PHP example:
gethostbyname('www.google.com'); //201.17.165.210
And in Python? How can I do this?
5
In reality python is almost that:
import socket
socket.gethostbyname('www.google.com') # 216.58.211.196
Browser other questions tagged python ip host
You are not signed in. Login or sign up in order to post.