
Title
Page icon
Create new category
Edit page index title
Edit category
Edit link
Application Fails Due to DNS Resolution Issue in Onprem Environment
Problem
An internal application was crashing due to DNS resolution failures from within a pod in an airgapped Kubernetes environment.
Environment
Self-Hosted Private Cloud Director Virtualization - v2025.4 and Higher
Self-Hosted Private Cloud Director Kubernetes - v2025.4 and Higher
Cause
The environment is air-gapped and cannot reach external nameservers, the internal nameservers defined on the node are not configured with the application's FQDN address mapping for domain name resolution. To work around this, an entry for <external-domain> was added to the /etc/hosts file on each node.
While this allows resolution from the node shell, it does not apply inside pods, as pod DNS resolution is handled by CoreDNS.
Diagnostics
Testing from the pod:
Testing from Node:
This confirms resolution works on the node via /etc/hosts or another resolver, but not within pods.
Resolution
Edit the CoreDNS ConfigMap:
Modify the Corefile section by adding or modifying the
hostsblock with the correct nameserver IP and fully qualified domain name (FQDN). For example:
Replace <EXTERNAL_IP_OF_SERVICE_MAPPED_TO_FQDN> with the actual IP address and <FQDN> with the correct FQDN of the application.
Save and exit the editor. This will update the ConfigMap.
Restart the CoreDNS pods to apply the new configuration:
Validate the coredns pods are up and running
Validation
After restarting CoreDNS, validate that the DNS resolution works:
Use a test pod to perform an
nslookup:
Ensure the application no longer crashes due to DNS resolution issues.
Confirm logs of the application or CoreDNS show successful resolution.
Additional Information
The
hostsplugin in CoreDNS is similar to the/etc/hostsfile and allows static DNS entries.fallthroughensures that if a name is not matched in thehostssection, CoreDNS will continue to other plugins likekubernetesorforward.Use
kubectl logs -n kube-system -l k8s-app=kube-dnsto check CoreDNS logs if resolution still fails.