'server can't find eureka-0.eureka.dabai-uat.svc.cluster.local: NXDOMAIN

Today I found the kubernetes dns service have a issue. When I am using this command to check the kubernetes 1.15 dns:

nslookup eureka-0.eureka.dabai-uat.svc.cluster.local

shows error:

Server:         10.254.0.2
Address:        10.254.0.2#53

** server can't find eureka-0.eureka.dabai-uat.svc.cluster.local: NXDOMAIN

I am sure the eureka-0 statefulsets is up. the coredns pod was up:

[root@ops001 ~]# kubectl get deployment -n kube-system|grep coredns
coredns                                           1/1     1            1           2y245d

the domain kubernetes.default and kubernetes.default.svc.cluster.local works fine:

root@dnsutils:/# nslookup kubernetes.default
Server:         10.254.0.2
Address:        10.254.0.2#53

Name:   kubernetes.default.svc.cluster.local
Address: 10.254.0.1

where is the problem and what should I do to fix it? This is the dns info:

[root@ops001 ~]# kubectl get pods --namespace=kube-system -l k8s-app=kube-dns
NAME                      READY   STATUS    RESTARTS   AGE
coredns-77b786f58-s5bzw   1/1     Running   0          21h
[root@ops001 ~]# kubectl get svc --namespace=kube-system
NAME                                              TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                        AGE
alertmanager                                      ClusterIP      10.254.193.27    <none>        80/TCP                         2y74d
grafana                                           NodePort       10.254.46.9      <none>        80:30000/TCP                   2y75d
kube-dns                                          ClusterIP      10.254.0.2       <none>        53/UDP,53/TCP,9153/TCP         2y245d
kubelet                                           ClusterIP      None             <none>        10250/TCP,10255/TCP,4194/TCP   2y80d
kubernetes-dashboard                              NodePort       10.254.75.193    <none>        9443:31085/TCP                 2y245d
metrics-server                                    ClusterIP      10.254.3.178     <none>        443/TCP                        618d
mysql-report-exporter-prometheus-mysql-exporter   ClusterIP      10.254.208.9     <none>        9104/TCP                       575d
prometheus                                        ClusterIP      10.254.200.46    <none>        9090/TCP                       2y75d
traefik                                           ClusterIP      10.254.169.66    <none>        80/TCP,443/TCP,8080/TCP        2y116d
traefik-2                                         LoadBalancer   10.254.143.242   <pending>     80:31211/TCP,443:30221/TCP     635d
[root@ops001 ~]# kubectl get ep kube-dns --namespace=kube-system
NAME       ENDPOINTS                                           AGE
kube-dns   172.30.248.7:53,172.30.248.7:53,172.30.248.7:9153   2y245d


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source