def resolve(host, mask=None):
    try:
        hostname, aliases, addresses = socket.gethostbyname_ex(str(host))
    except socket.gaierror as why:
        raise ValueError("Unable to resolve host: %s" % (why[1]))
    if addresses:
        return IPv4(addresses[0], mask)
    else:
        raise ValueError("No addresses found.")
Resolve a hostname to an IPv4 object. An optional mask value may me supplied.
dataset/ETHPy150Open kdart/pycopia/core/pycopia/ipv4.py/resolve