MCPcopy Index your code
hub / github.com/sshuttle/sshuttle / _check_revdns

Function _check_revdns

sshuttle/hostwatch.py:137–148  ·  view source on GitHub ↗

Use reverse DNS to try to get hostnames from an IP addresses.

(ip)

Source from the content-addressed store, hash-verified

135
136
137def _check_revdns(ip):
138 """Use reverse DNS to try to get hostnames from an IP addresses."""
139 debug2(' > rev: %s' % ip)
140 try:
141 r = socket.gethostbyaddr(ip)
142 debug3('< %s' % r[0])
143 check_host(r[0])
144 found_host(r[0], ip)
145 except (OSError, socket.error, UnicodeError):
146 # This case is expected to occur regularly.
147 # debug3('< %s gethostbyaddr failed on remote host' % ip)
148 pass
149
150
151def _check_dns(hostname):

Callers

nothing calls this directly

Calls 4

debug2Function · 0.90
debug3Function · 0.90
check_hostFunction · 0.85
found_hostFunction · 0.85

Tested by

no test coverage detected