6

As the title states, I am having an issue with resolving service names within my K8's cluster.

As per this question, I created a busybox pod and tried to resolve an existing service name using nslookup nginx-service. I get the error: ;; connection timed out; no servers could be reached

I also tried the instructions on the official K8's documentation on how to debug DNS issues. As it states, I tried to do an nslookup kubernetes.default but got the same error as before.

Listed below is some information:

1) Output of cat /etc/resolv.conf

nameserver 10.96.0.10
search default.svc.cluster.local svc.cluster.local cluster.local 
reddog.microsoft.com
options ndots:5

2) Result of kubectl get pods --namespace=kube-system -l k8s-app=kube-dns

NAME                       READY   STATUS    RESTARTS   AGE
coredns-5c98db65d4-5nprd   1/1     Running   0          3d22h
coredns-5c98db65d4-5vw95   1/1     Running   0          3d22h

3) Output of for p in $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name); do kubectl logs --namespace=kube-system $p; done

.:53
2019-07-22T18:39:37.208Z [INFO] CoreDNS-1.3.1
2019-07-22T18:39:37.208Z [INFO] linux/amd64, go1.11.4, 6b56a9c
CoreDNS-1.3.1
linux/amd64, go1.11.4, 6b56a9c
2019-07-22T18:39:37.208Z [INFO] plugin/reload: Running configuration MD5 = 5d5369fbc12f985709b924e721217843
.:53
2019-07-22T18:39:37.245Z [INFO] CoreDNS-1.3.1
2019-07-22T18:39:37.245Z [INFO] linux/amd64, go1.11.4, 6b56a9c
CoreDNS-1.3.1
linux/amd64, go1.11.4, 6b56a9c
2019-07-22T18:39:37.245Z [INFO] plugin/reload: Running configuration MD5 = 5d5369fbc12f985709b924e721217843

For what it's worth, since I know that the DNS server is at 10.96.0.10 when I try to ping that IP, I don't get a response.

EDIT: Output of dig @10.96.0.10 nginx-service

; <<>> DiG 9.11.3 <<>> @10.96.0.10 nginx-service
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached
user538578964
  • 723
  • 9
  • 25
  • " DNS server is at 10.96.0.10 when I try to ping that IP, I don't get a response." ping is a poor troubleshooting tool. Try `dig @10.96.0.10 somename`. If you get a timeout, with and without `+tcp` then you have a network filtering problem or the DNS server just does not run (or not at this IP) – Patrick Mevzek Jul 26 '19 at 17:56
  • @PatrickMevzek Hi. I edited my question with the output of the `dig` command. Please check. Also, I think DNS should run at this IP because its the DNS server specified in the `resolv.conf` file – user538578964 Jul 26 '19 at 18:20
  • 1
    Have you checked whether your NGINX pod is up and running, and is reachable via its IP address from toolbox Pod ? 1. kubectl get svc/nginx-service -o jsonpath='{.spec.clusterIP}' 2. curl – Nepomucen Jul 29 '19 at 10:11
  • 1
    What Kubernetes setup you are working on, Managed by Cloud provider, On-Premise ? – Nepomucen Jul 29 '19 at 10:14
  • I have the same problem. did you find any solution? – florin Mar 02 '20 at 17:56
  • 1
    @florin very sorry for the late reply.. It turned out my cluster CDN was not working properly. I was using Calico. I uninstalled calico and installed Flannel. That worked. – user538578964 Sep 09 '20 at 15:07
  • I also have the same issue with Flannel. – Damith Udayanga Nov 21 '20 at 18:20

0 Answers0