dns-debug
Skill236 starsChanged 6 months agoApache-2.0View on GitHub
Diagnose DNS resolution failures in the cluster (NXDOMAIN, timeouts, SERVFAIL). Checks CoreDNS health, service endpoints, and DNS configuration.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- kbc/CLAUDE.mdCLAUDE.md
- cluster-eventsSkill
- deployment-rollout-debugSkill
- gateway-diagnosticsSkill
- hpa-debugSkill
- http-log-statsSkill
- image-pull-debugSkill
- ingress-debugSkill
- job-debugSkill
- networkpolicy-debugSkill
- node-health-checkSkill
- node-logsSkill
- pod-crash-debugSkill
- pod-pending-debugSkill
- pvc-debugSkill
- quota-debugSkill
- service-debugSkill
- statefulset-debugSkill
- volcano-diagnose-podSkill
- volcano-gang-schedulingSkill
- volcano-job-diagnoseSkill
- volcano-node-resourcesSkill
- volcano-queue-diagnoseSkill
- volcano-resource-insufficientSkill
- volcano-scheduler-configSkill
- volcano-scheduler-logsSkill
- manage-skillSkill
- skill-authoringSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 6 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
When pods report DNS resolution failures (service discovery not working, NXDOMAIN errors, DNS timeouts), follow this flow to identify the …
- Distinctive: line 18
If a specific pod is having DNS issues, test DNS resolution from within that pod:
- Very specific: line 30
If nslookup is not available in the container, try:
- Very specific: line 44
All CoreDNS pods should be Running and Ready.
- Distinctive: line 52
Look for error messages, SERVFAIL responses, or upstream DNS failures.
- Distinctive: line 84
Check CoreDNS pod health (step 2).
- Very specific: line 105
Look for the forward directive — it defines where CoreDNS forwards external queries.
- Distinctive: line 113
Check the pod's DNS configuration:
- Very specific: line 119
If ndots:5 is set and the pod frequently resolves external domains, advise the user to set dnsConfig.options in the pod spec to lower ndots …
- Distinctive: line 138
Check CoreDNS pod status and events for why they are not ready.
- Very specific: line 144
If testing DNS from outside the cluster, remember that *.svc.cluster.local names are only resolvable from within the cluster.
- Very specific: line 145
If DNS timeouts only affect specific pods (not cluster-wide), an egress NetworkPolicy may be blocking UDP/TCP port 53 — use …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
DNS Resolution Failure Diagnosis
When pods report DNS resolution failures (service discovery not working, NXDOMAIN errors, DNS timeouts), follow this flow to identify the root cause.
Scope: This skill is for diagnosis only. Once you identify the root cause, report it to the user and stop. Do NOT attempt to modify CoreDNS configuration or network policies — that should be left to the user or cluster administrator.
Diagnostic Flow
1. Verify DNS resolution from a pod
If a specific pod is having DNS issues, test DNS resolution from within that pod:
pod_exec: pod=<pod>, namespace=<ns>, command="nslookup <service-name>"For cross-namespace service resolution:
pod_exec: pod=<pod>, namespace=<ns>, command="nslookup <service-name>.<target-namespace>.svc.cluster.local"If nslookup is not available in the container, try:
pod_exec: pod=<pod>, namespace=<ns>, command="cat /etc/resolv.conf"This shows the DNS server the pod is configured to use and the search domains.
2. Check CoreDNS pod status
kubectl get pods -n kube-system -l k8s-app=kube-dns -o wideAll CoreDNS pods should be Running and Ready. Note which nodes they are running on.
3. Check CoreDNS logs
kubectl logs -n kube-system -l k8s-app=kube-dns --tail=100Look for error messages, SERVFAIL responses, or upstream DNS failures.
4. Check DNS Service and Endpoints
kubectl get svc -n kube-system kube-dns
kubectl get endpoints -n kube-system kube-dnsThe kube-dns service should have a ClusterIP, and the endpoints should list the CoreDNS pod IPs. If endpoints are empty, CoreDNS pods are not ready.
5. Match error and conclude
NXDOMAIN / server can't find — Name does not exist
The DNS name cannot be resolved. Common causes:
- Typo in service name — verify the service exists:
kubectl get svc -n <target-namespace> <service-name> - Wrong namespace — services must be referenced as
<service>.<namespace>.svc.cluster.localfrom other namespaces - Service doesn't exist — the target service has not been created
- Headless service with no endpoints — the service exists but has no backing pods
Advise the user to verify the service name, namespace, and that the target service exists with ready endpoints.
connection timed out / no servers could be reached — DNS timeout
DNS queries are not reaching CoreDNS or CoreDNS is not responding.
Check CoreDNS pod health (step 2). If CoreDNS pods are healthy, possible causes:
- Network policy blocking DNS traffic (UDP/TCP port 53 to kube-dns service)
- Node-level network issue — the pod's node may have connectivity problems to CoreDNS nodes
- CoreDNS overloaded — too many DNS queries overwhelming CoreDNS
kubectl top pods -n kube-system -l k8s-app=kube-dnsSERVFAIL — Server failure
CoreDNS received the query but failed to resolve it. Common causes:
- Upstream DNS failure — CoreDNS cannot reach the upstream/external DNS server
- Invalid CoreDNS configuration — check the CoreDNS ConfigMap
kubectl get configmap -n kube-system coredns -o yamlLook for the forward directive — it defines where CoreDNS forwards external queries.
ndots / slow external DNS resolution — Search domain misconfiguration
By default, Kubernetes sets ndots:5 in pods' resolv.conf, causing external domains (e.g., api.example.com) to be tried with cluster search domains first, leading to unnecessary NXDOMAIN queries before the real resolution.
Check the pod's DNS configuration:
pod_exec: pod=<pod>, namespace=<ns>, command="cat /etc/resolv.conf"If ndots:5 is set and the pod frequently resolves external domains, advise the user to set dnsConfig.options in the pod spec to lower ndots or add specific searches entries.
CoreDNS pods CrashLoopBackOff / not ready — CoreDNS failure
CoreDNS itself is failing. Check CoreDNS logs (step 3) for the specific error.
Common causes:
- Invalid Corefile — syntax error in CoreDNS ConfigMap
- Upstream DNS unreachable — the
forwardtarget is not reachable - Resource exhaustion — CoreDNS pods need more CPU/memory
Endpoints empty for kube-dns — No CoreDNS backends
The DNS service has no endpoints, meaning no CoreDNS pods are ready. All DNS queries in the cluster will fail.
Check CoreDNS pod status and events for why they are not ready.
Notes
- The
kube-dnsservice name is used even when CoreDNS is the DNS provider — this is for backwards compatibility. - For pods using
hostNetwork: true, DNS resolution uses the node's/etc/resolv.confinstead of the cluster DNS. These pods cannot resolve cluster-internal service names by default. - If testing DNS from outside the cluster, remember that
*.svc.cluster.localnames are only resolvable from within the cluster. - If DNS timeouts only affect specific pods (not cluster-wide), an egress NetworkPolicy may be blocking UDP/TCP port 53 — use
networkpolicy-debugto check before investigating CoreDNS.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

