MCPcopy
hub / github.com/n0a/telegram-get-remote-ip / get_hostname

Function get_hostname

tg_get_ip.py:66–71  ·  view source on GitHub ↗

Retrieve hostname for the given IP.

(ip)

Source from the content-addressed store, hash-verified

64
65
66def get_hostname(ip):
67 """Retrieve hostname for the given IP."""
68 try:
69 return socket.gethostbyaddr(ip)[0]
70 except socket.herror:
71 return None
72
73def get_my_ip():
74 """Retrieve the external IP address."""

Callers 2

get_whois_infoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected