You are here : python_3socketsocketgethostbyaddr

socket.gethostbyaddr() - socket

Return a triple (hostname, aliaslist, ipaddrlist) where hostname is the
primary host name responding to the given ip_address, aliaslist is a
(possibly empty) list of alternative host names for the same address, and
ipaddrlist is a list of IPv4/v6 addresses for the same interface on the same
host (most likely containing only a single address). To find the fully qualified
domain name, use the function getfqdn(). gethostbyaddr() supports
both IPv4 and IPv6.


Syntax

socket.gethostbyaddr(ip_address)


Example


Output / Return Value


Limitations


Alternatives / See Also


Reference