def METHOD_NAME(ip,
                        timeout=__DEFAULT_TIMEOUT__):
    """
    Resolve an IP (v4 or v6) to its hostname, returning None if not
    found or there was a timeout.
    """
    """
    Reverse-resolve a host using the system's facilities
    """
    # TODO: It would be nice of the queue/timeout code wasn't duplicated
    # TODO: Validate 'ip' as an IP and raise a ValueError
    def proc(ip_addr, timing_queue):
        """Process the query"""
        try:
            timing_queue.put(socket.gethostbyaddr(ip_addr)[0])
        except socket.herror:
            timing_queue.put(None)
        except socket.gaierror as ex:
            if ex.errno not in [-2, -5]:
                raise ex
            timing_queue.put(None)
    timing_queue = queue.Queue()
    thread = threading.Thread(target=proc, args=(ip, timing_queue))
    thread.setDaemon(True)
    thread.start()
    try:
        return timing_queue.get(True, timeout)
    except queue.Empty:
        return None
    # NOTE: Don't make any attempt to kill the thread, as it will get
    # Python all confused if it holds the GIL.