Kubernetes / Services, DNS & Traffic Routing
Investigate a Pod using an unexpected DNS policy
A host-networked or specially configured Pod can resolve names differently from ordinary application Pods. Inspect DNS configuration intent.
Environment and inputs: Kubernetes · kubectl with supported client/server versions and delegated RBAC. Examples use namespace app unless noted. Check context, namespace, APIs and provider support first.
Start with this check
Check which system and tools you are using. Replace example objects, namespaces, images, file paths and hosts with approved values. Remove sensitive information before sharing output. Follow the application owner’s process for changes.
kubectl -n app get pod web-0 -o jsonpath='{.spec.hostNetwork}{" "}{.spec.dnsPolicy}{" "}{.spec.dnsConfig}'
What the results mean
The fields describe Pod DNS policy and overrides. The node's resolver behavior and cluster domain still influence the resulting configuration.
Fix the cause and check again
Compare policy with the supported host-network or normal-Pod design, then inspect the actual resolver file through an approved method. Correct only the intended workload configuration.
Before changing production
Do not hard-code a public resolver into every Pod or bypass internal service discovery.