Use reverse DNS to try to get hostnames from an IP addresses.
(ip)
| 135 | |
| 136 | |
| 137 | def _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 | |
| 151 | def _check_dns(hostname): |
nothing calls this directly
no test coverage detected