import socket


def gethostbyaddr(ip):
    """
    Resolve a single host name with gethostbyaddr. Returns a string on success.
    If resolution fails, returns None.
    """
    host = None
    try:
        host = socket.gethostbyaddr(ip)[0]
    except OSError:
        pass
    return host