def METHOD_NAME(name):
    """Given a name that can be either an ip or a hostname/domain name, this
    function looks up IP and hostname.
    name - ip or hostname
    Returns:
     - tuple with ip-addres and sysname
    """
    try:
        ip_addr = IP(name)
    except ValueError:
        ip_addr = IP(gethostbyname(name))
    try:
        sysname = gethostbyaddr(str(ip_addr))[0]
    except SocketError:
        sysname = str(ip_addr)
    return (ip_addr, sysname)