def _labels_to_reverse_name(labels, ip_type):
    """
    Convert a list of octets (IPv4) or nibbles (IPv6) to a reverse domain name
    """
    name = '.'.join(list(reversed(labels)))
    name += '.in-addr.arpa' if ip_type == '4' else '.ip6.arpa'
    return name