import random


def generate_node_ids(num_ns, num_lns, rand_seed):
    """ Generates node IDs for name servers, and local name servers by using given seed for random number generator
    """
    random.seed(rand_seed)
    ns_ids = []
    while len(ns_ids) != num_ns:
        node_id = random.randint(0, 1000000)
        if node_id not in ns_ids:
            ns_ids.append(node_id)
    lns_ids = []
    while len(lns_ids) != num_lns:
        node_id = random.randint(0, 1000000)
        if node_id not in lns_ids and node_id not in ns_ids:
            lns_ids.append(node_id)
    return ns_ids, lns_ids