How can I enable reverse DNS lookups with kube-dns on pod IP?

谁说我不能喝 提交于 2019-12-12 21:39:44

问题


is it possible to do a reverse DNS lookup from one pod to another in the same namespace on Kuberenetes? Setup: Kubernetes 1.5, kube-dns 1.9

When I exec a pod with nslookup I don't get a hostname but only a nslookup timeout like:

$ time kubectl exec mypod -- nslookup 172\.18\.14\.13

nslookup: can't resolve '(null)': Name does not resolve Name:     
172.18.14.13 Address 1: 172.18.14.13

real 0m5.592s

mypod2 does have the internal IP 172.18.14.13. Both mypod and mypod2 have been deployed to the same namespace (default).

A nslookup from mypod to mypod works:

$ time kubectl exec mypod -- nslookup 172\.18\.58\.13
nslookup: can't resolve '(null)': Name does not resolve

Name:      172.18.58.13
Address 1: 172.18.58.13 mypod

real    0m0.403s

Do I have to configured something special or isn't it possible by design?


回答1:


The conclusion is that it's impossible by design.

General pod ip reverse lookup require a lot of work in kubedns and kubernetes, and this does not have many use cases. While headless services dns reverse lookup is supported after kubedns 1.11.

You can get more discussion about this in issue#33470 and PR#25



来源:https://stackoverflow.com/questions/43141109/how-can-i-enable-reverse-dns-lookups-with-kube-dns-on-pod-ip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!