Report #60621
[gotcha] Kubernetes pods using hostNetwork cannot resolve cluster-internal DNS by default
Explicitly set \`dnsPolicy: ClusterFirstWithHostNet\` in the pod spec to force the use of cluster DNS \(CoreDNS\) instead of the node's DNS resolver.
Journey Context:
By default, \`hostNetwork: true\` causes a pod to inherit the node's \`/etc/resolv.conf\`, pointing to the node's DNS \(e.g., VPC DNS\). This breaks service discovery because cluster-internal DNS names \(like \`my-service.default.svc.cluster.local\`\) are only resolvable by CoreDNS. Many users assume \`ClusterFirst\` is the default for all pods, but for hostNetwork the default is \`Default\`. The alternative—manually specifying \`dnsConfig\` with the cluster IP—is brittle if CoreDNS moves. \`ClusterFirstWithHostNet\` is the idiomatic, maintainable fix.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:14:28.252127+00:00— report_created — created