Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coredns can't resolve domain #111

Closed
lvs071103 opened this issue Nov 21, 2018 · 6 comments
Closed

coredns can't resolve domain #111

lvs071103 opened this issue Nov 21, 2018 · 6 comments

Comments

@lvs071103
Copy link

deploy setup:

./deploy.sh -s -r 10.254.0.0/16 -i 10.254.0.2 -d clouster.local > coredns.yaml
kubectl create -f coredns.yaml
kubectl get pods,svc -n kube-system 
NAME                           READY   STATUS    RESTARTS   AGE
pod/coredns-55c956c95c-2k928   1/1     Running   0          10h
pod/coredns-55c956c95c-d685d   1/1     Running   0          10h

NAME               TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)         AGE
service/kube-dns   ClusterIP   10.254.0.2   <none>        53/UDP,53/TCP   10h

another pod can't resolve domains, for example:

[root@k8s-master ~]# kubectl get pods,svc --all-namespaces
NAMESPACE     NAME                           READY   STATUS    RESTARTS   AGE
default       pod/nginx-774d74897-47zbm      1/1     Running   0          11h
default       pod/nginx-774d74897-jt6rj      1/1     Running   0          11h
default       pod/test-dns-d854db9-8s8w9     1/1     Running   1          10h
kube-system   pod/coredns-55c956c95c-2k928   1/1     Running   0          10h
kube-system   pod/coredns-55c956c95c-d685d   1/1     Running   0          10h

NAMESPACE     NAME                      TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)         AGE
default       service/example-service   NodePort    10.254.139.43   <none>        80:30163/TCP    11h
default       service/kubernetes        ClusterIP   10.254.0.1      <none>        443/TCP         16h
kube-system   service/kube-dns          ClusterIP   10.254.0.2      <none>        53/UDP,53/TCP   10h
[root@k8s-master ~]# kubectl exec -it test-dns-d854db9-8s8w9 /bin/sh
/ # nslookup kubernetes.default
Server:		10.254.0.2
Address:	10.254.0.2:53

** server can't find kubernetes.default: NXDOMAIN

*** Can't find kubernetes.default: No answer

/ # nslookup kube-dns
nslookup: write to '10.254.0.2': Connection refused
;; connection timed out; no servers could be reached

/ # nslookup example-service
Server:		10.254.0.2
Address:	10.254.0.2:53

** server can't find example-service: NXDOMAIN

*** Can't find example-service: No answer

my deployment method correct?

@chrisohaver
Copy link
Member

./deploy.sh -s -r 10.254.0.0/16 -i 10.254.0.2 -d clouster.local > coredns.yaml

"clouster.local" looks like a typo.

@lvs071103
Copy link
Author

change to cluster.local, but still not resolve

# kubectl exec -it dnstools -- /bin/sh
dnstools# nslookup example-service
;; connection timed out; no servers could be reached

@chrisohaver
Copy link
Member

chrisohaver commented Nov 22, 2018 via email

@lvs071103
Copy link
Author

cool, internal is OK! thanks a lot

# kubectl run -it --rm --restart=Never --image=infoblox/dnstools:latest dnstools
If you don't see a command prompt, try pressing enter.
dnstools# nslookup example-service
Server:		10.254.0.2
Address:	10.254.0.2#53

Name:	example-service.default.svc.cluster.local
Address: 10.254.26.98

@lvs071103
Copy link
Author

public cloud is not OK! I will continue try, thank you

@Davidrjx
Copy link

Davidrjx commented Nov 6, 2019

@chrisohaver hi, i am facing same problem but both internal & external domain do not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants