def get_ipv4(hostname):
    """Get list of ipv4 addresses for hostname

    """
    addrinfo = socket.getaddrinfo(hostname, None, socket.AF_INET,
                                  socket.SOCK_STREAM)
    return [addrinfo[x][4][0] for x in range(len(addrinfo))]
Get list of ipv4 addresses for hostname