def is_ipv6(addr):
    sockaddrs = socket.getaddrinfo(addr, None)
    if any([addr_tuple[0] == socket.AF_INET for addr_tuple in sockaddrs]):
        return False
    return True
For hostnames, we will use IPv4, if both IPv4 and IPv6 are present as
dataset/ETHPy150Open swiftstack/ssbench/ssbench/util.py/is_ipv6