socket.gethostbyaddr(ip_address)
- The functions translates an ip address into
(hostname, aliaslist, ipaddrlist) Hostnameis the primary host name responding to the givenip_addressAliaslistis a list of alternative host names for the same addressIpaddrlistis a list of IPv4/v6 addresss for the same interface on the same host
Example of gethostbyaddr
>>> import socket
>>> socket.gethostbyaddr('192.0.43.8')
('43-8.any.icann.org', ['8.43.0.192.in-addr.arpa'],
['192.0.43.8'])References
Previous
Next