def target_down_dns_silencer(alert: PrometheusKubernetesAlert):
    """
    Silences the prometheus TargetDown alert if the dns service doesn't exist or if the wrong dns is configured
    """
    job = alert.get_alert_label("job")
    service = alert.get_alert_label("service")
    if job not in ["coredns", "kube-dns"]:
        return
    res = list_available_services("kube-system")
    try:
        res = json.loads(res)
    except json.decoder.JSONDecodeError:
        res = {}
    items = res.get("items", [])
    dns_service_found = False
    for kube_item in items:
        kube_item_name = kube_item.get("metadata", {}).get("name")
        if kube_item_name == service:
            dns_service_found = True
            break

    other_dns = "kube-dns" if job == "coredns" else "coredns"
    # wrong dns is set up i.e. coredns when should be kube-dns
    if has_dns_deployment(alert.label_namespace, other_dns):
        silence_reason = f"{ other_dns} should be configured instead"
        silence_target_down(alert, job, silence_reason)

    # the dns service does not exist
    if not dns_service_found:
        silence_reason = f"Service {service} not found."
        silence_target_down(alert, job, silence_reason)
    else:
        # We cannot reach out the service, so alert should be risen
        pass

    Silences the prometheus TargetDown alert if the dns service doesn't exist or if the wrong dns is configured
    
playbooks/robusta_playbooks/targetdown_enrichment.py