Agent skill
investigate-dns-config
Investigate DNSConfigForming warnings on pods. Analyzes DNS policy configuration, host network settings, and nameserver limits. Use when pods show DNSConfigForming events or DNS-related warnings. Keywords: DNS, DNSConfigForming, nameserver limit, resolv.conf, dnsPolicy, hostNetwork.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/investigate-dns-config
Metadata
Additional technical details for this skill
- domain
- k8s
- category
- diagnostic
- confidence
- 0.85
- mcp servers
-
[ "kubernetes-mcp-server" ] - requires approval
- NO
SKILL.md
Investigate DNS Configuration Issues
Preconditions
Before applying this skill, verify:
- Event shows DNSConfigForming reason
- Pod name and namespace are known from event
- Pod may have been recreated (check for similar pods)
Actions
1. Get Related Events
Gather all DNS-related events in the namespace for context.
mcp_tool: kubernetes-mcp-server/events_list
params:
namespace: $namespace
timeout: 30s
Analysis: Look for DNSConfigForming events, note affected pods and messages.
2. List Affected Pods
Find pods managed by the same controller (may have been recreated).
mcp_tool: kubernetes-mcp-server/pods_list_in_namespace
params:
namespace: $namespace
labelSelector: $label_selector
timeout: 30s
Analysis: Identify running pods that may be affected.
3. Get Controller Configuration
Get the DaemonSet/Deployment/StatefulSet that manages the pod.
mcp_tool: kubernetes-mcp-server/resources_get
params:
apiVersion: apps/v1
kind: $controller_kind
name: $controller_name
namespace: $namespace
timeout: 30s
Analysis: Check for:
hostNetwork: true- Pod uses host networkingdnsPolicy- Current DNS policy setting
4. Determine Root Cause
Based on findings, identify the root cause:
| Condition | Root Cause | Recommendation |
|---|---|---|
hostNetwork: true + dnsPolicy: ClusterFirst |
Nameserver limit exceeded when combining cluster DNS with host DNS | Change to dnsPolicy: ClusterFirstWithHostNet |
hostNetwork: true + no explicit dnsPolicy |
Same as above (ClusterFirst is default) | Set dnsPolicy: ClusterFirstWithHostNet |
hostNetwork: false + DNSConfigForming |
Node has >3 nameservers | Usually benign, first 3 nameservers are used |
Success Criteria
The skill succeeds when:
- Root cause of DNSConfigForming identified
- Controller configuration analyzed
- Remediation recommendation provided
Failure Handling
If investigation is inconclusive:
- Check node's /etc/resolv.conf via node logs
- Verify CoreDNS is running correctly
- Escalate with gathered diagnostic info
Examples
Input Context:
{
"namespace": "monitoring",
"pod_name": "prometheus-node-exporter-abc123",
"event_reason": "DNSConfigForming",
"event_message": "Nameserver limits were exceeded, some nameservers have been omitted"
}
Investigation Output:
{
"affected_pods": ["prometheus-node-exporter-abc123", "prometheus-node-exporter-def456"],
"controller": {
"kind": "DaemonSet",
"name": "prometheus-prometheus-node-exporter",
"hostNetwork": true,
"dnsPolicy": "ClusterFirst"
},
"root_cause": "DaemonSet uses hostNetwork: true with default dnsPolicy: ClusterFirst, causing nameserver limit conflicts",
"recommendation": {
"action": "Update Helm values to set dnsPolicy: ClusterFirstWithHostNet",
"requires_approval": false,
"gitops_path": "gitops/apps/monitoring/prometheus-helmrelease.yaml"
}
}
Remediation Notes
For Helm-managed resources:
- Identify the HelmRelease in GitOps
- Add
dnsPolicy: ClusterFirstWithHostNetto the subchart values - Commit and let Flux CD apply the change
For direct Kubernetes resources:
- Patch the controller with updated dnsPolicy
- Pods will be recreated with correct DNS configuration
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?