Not able to nslookup kubernetes.default
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
When dealing with Kubernetes clusters, one of the common issues that can be encountered is the inability to perform an `nslookup` on the `kubernetes.default` service. This article delves into the technical aspects of this issue, providing explanations and examples on where the problem might lie, and how to potentially resolve it.
Understanding the `kubernetes.default` Service
In a Kubernetes cluster, the `kubernetes.default` service is a special service entry that enables access to the Kubernetes API server. It is automatically created in the `default` namespace and typically points to the IP address of the API server. The DNS resolution of this service is crucial for internal cluster processes that rely on communicating with the API server.
Common Issues with `nslookup` on `kubernetes.default`
1. DNS Not Configured Correctly
Kubernetes constructs a DNS service using `CoreDNS` or `kube-dns` to resolve domain names. If `nslookup kubernetes.default` fails, the DNS solution might be misconfigured.
Example:
If CoreDNS pods are not running or if there are issues with their configuration, the DNS queries may fail, causing an inability to resolve `kubernetes.default`.
2. Network Policies or Firewall Rules
Network policies in Kubernetes or firewall rules in the underlying network can restrict the flow of DNS traffic, leading to resolution issues.
Example:
A strict network policy that blocks traffic from the application’s namespace to the `kube-system` namespace where CoreDNS usually runs, will prevent DNS resolution.
3. CNI Plugin Issues
Kubernetes relies on a Container Network Interface (CNI) plugin for pod networking. Any issues with this plugin may result in network traffic, including DNS queries, not being routed correctly.
Example:
If the CNI plugin such as Calico or Flannel is misconfigured, it can cause DNS queries to fail by dropping packets or not routing them as required.
4. Pod DNS Configuration
Each Kubernetes pod gets a default DNS configuration. Sometimes, custom configuration can override or misconfigure this causing dns resolution to fail.
Example:
If a pod explicitly sets its `dnsConfig`, and that configuration is incorrect, DNS queries from within the pod to `kubernetes.default` will fail.
Troubleshooting Steps
Step 1: Check CoreDNS Pods
Ensure that all CoreDNS Pods are running. Use the following command:
Related reading
- Not able to SSH EKS Worker Nodes
- On kubernetes helm how to replace a pod with new config values
- One istio-ingressgateway and multiple TLS gateways
- One or more containers do not have resource limits - warning in VS Code Kubernetes tools
- Nothing is being detected in Tensorflow Object detection API
- nslookup can not get service ip on latest busybox
- Not able to Start rabbitmq server in centos 7 using systemctl
- Not receiving Amazon SES Bounce Notifications

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.