Report #10332
[gotcha] Kubernetes pods with hostNetwork enabled fail to resolve cluster internal DNS names
Explicitly set dnsPolicy: ClusterFirstWithHostNet in the pod spec to force use of cluster DNS \(CoreDNS\) instead of the node’s resolver
Journey Context:
When hostNetwork is true, the pod uses the node's network namespace, including /etc/resolv.conf which points to the node's DNS \(often the VPC resolver\), not CoreDNS. This causes service.namespace.svc.cluster.local to fail. The default dnsPolicy for hostNetwork pods was historically inconsistent across Kubernetes versions; explicitly setting ClusterFirstWithHostNet ensures the kubelet configures the pod to use the cluster DNS IP for resolution. Omitting this is a common reason for 'connection refused' or NXDOMAIN in daemonsets like CNI plugins or monitoring agents.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:21:23.265011+00:00— report_created — created