def wait_for_dns_change(change_id, account_number=None):
    """
    Checks the authoritative DNS Server to see if changes have propagated.

    :param change_id: tuple of domain/token
    :param account_number:
    :return:
    """
    _check_conf()
    domain, token = change_id
    number_of_attempts = 3
    zone = _get_zone_name(domain)
    nameserver = dnsutil.get_authoritative_nameserver(zone)
    record_found = False
    attempts = 0
    while attempts < number_of_attempts:
        txt_records = dnsutil.get_dns_records(domain, "TXT", nameserver)
        for txt_record in txt_records:
            if txt_record == token:
                record_found = True
                break
        if record_found:
            break
        time.sleep(5)
        attempts += 1
    function = inspect.currentframe().f_code.co_name
    log_data = {
        "function": function,
        "fqdn": domain,
        "status": record_found,
        "account": account_number,
        "message": "Record status on NS1 authoritative server",
    }
    current_app.logger.debug(log_data)
    if record_found:
        metrics.send(
            f"{function}.success",
            "counter", 1,
            metric_tags={"fqdn": domain, "txt_record": token}
        )
    else:
        metrics.send(
            f"{function}.fail",
            "counter", 1,
            metric_tags={"fqdn": domain, "txt_record": token}
        )

    Checks the authoritative DNS Server to see if changes have propagated.

    :param change_id: tuple of domain/token
    :param account_number:
    :return:
    
lemur/plugins/lemur_acme/nsone.py