-
Notifications
You must be signed in to change notification settings - Fork 127
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
Why nslookup can't resolv short name? #27
Comments
I can't seem to reproduce with any of our three variants. 😞 $ docker network create test
32024cd09daca748f8254468f4f00893afc2e1173c378919b1f378ed719f1618
$ docker run -dit --name nginx --network test nginx:alpine
7feaf1f0b4f3d421603bbb984854b753c7cbc6b581dd0a304d3b8fccf8c6604b
$ docker run -it --rm --network test busybox:uclibc nslookup nginx
Server: 127.0.0.11
Address 1: 127.0.0.11
Name: nginx
Address 1: 172.22.0.2 nginx.test
$ docker run -it --rm --network test busybox:glibc nslookup nginx
Server: 127.0.0.11
Address 1: 127.0.0.11
Name: nginx
Address 1: 172.22.0.2 nginx.test
$ docker run -it --rm --network test busybox:musl nslookup nginx
nslookup: can't resolve '(null)'
Name: nginx
Address 1: 172.22.0.2 nginx.test |
Thank you, tianon With busybox:glibc, I can resolve the short name too:
busybox1 is based on busybox:glibc With busybox:lastest, I can't
busybox is based on busybox:latest |
Ah, it's not specific to short names, but DNS search paths; here's a better example for reproducing: $ docker network create --internal test
66b1bf0bf05cec6d32c171cc601b6ee160bb94de670b0c61a0a15ae267302d06
$ docker run -dit --name nginx.domain --network test nginx:alpine
448e9b11cfb336464494c615be81db3058431f623eb9416507f5f46e19b2455c
$ docker run -it --rm --network test --dns-search domain busybox:glibc nslookup nginx
Server: 127.0.0.11
Address 1: 127.0.0.11
Name: nginx
Address 1: 172.22.0.2 nginx.domain.test
$ docker run -it --rm --network test --dns-search domain busybox:uclibc nslookup nginx
Server: 127.0.0.11
Address 1: 127.0.0.11
nslookup: can't resolve 'nginx'
$ docker run -it --rm --network test --dns-search domain busybox:musl nslookup nginx
nslookup: can't resolve '(null)'
nslookup: can't resolve 'nginx'
( 😞 Not sure where to start digging on this one. 😕 |
The image currently used is busybox:1.28.0 which uses uclibc. This is causing nslookup to fail name resolution when it shouldn't in some environments. The version of busybox that uses glibc does not suffer the same problem. Related: docker-library/busybox#9 docker-library/busybox#27
The image currently used is busybox:1.28.0 which uses uclibc. This is causing nslookup to fail name resolution when it shouldn't in some environments. The version of busybox that uses glibc does not suffer the same problem. Related: docker-library/busybox#9 docker-library/busybox#27
The implementation is broken with non-glibc, reportedly due to fiddling with its internals: https://dev.openwrt.org/ticket/18333 and https://bugs.busybox.net/show_bug.cgi?id=675 |
Seems only uclibc is broken now $ docker network create --internal test
d0f3b32461787a7d830cb7f73504db08a563dddbe1a93079bcd7b4034f7736de
$ docker run -dit --name nginx --network test nginx:alpine
bb795c7ddcee2043f1e4c6ce41d292af6e8497c29e80777f267864145052b345
$ docker run -it --rm --network test --dns-search domain busybox:glibc nslookup nginx
Server: 127.0.0.11
Address: 127.0.0.11:53
Non-authoritative answer:
Non-authoritative answer:
Name: nginx
Address: 172.22.0.2
$ docker run -it --rm --network test --dns-search domain busybox:uclibc nslookup nginx
Server: 127.0.0.11
Address: 127.0.0.11:53
Non-authoritative answer:
*** Can't find nginx: No answer
$ docker run -it --rm --network test --dns-search domain busybox:musl nslookup nginx
Server: 127.0.0.11
Address: 127.0.0.11:53
Non-authoritative answer:
Non-authoritative answer:
Name: nginx
Address: 172.22.0.2 |
I am seeing the behavior with uclibc and glibc on a Google Kubernetes instance. Shouldn't nslookup return with 1 as well if the lookup failed? I stumbled upon the problem when playing with init containers as described in the Kubernetes documentation: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ |
nslookup in the busybox image seems to be broken. It always returns with 0 even when the lookup fails. Additionally, it fails to resolve DNS paths. See docker-library/busybox#27
How does this relate to #48? Are they the same issue? |
From what I can tell, the new resolver in BusyBox's |
(See https://bugs.busybox.net/show_bug.cgi?id=11161 for where this is filed upstream.) I'm going to close this in favor of #48, where there's been slightly more recent discussion. 👍 |
I'm using the newest container of busybox to run nslookup, but can't get short name resolved. any hints?
nslookup nginx
Server: 192.168.192.10
Address 1: 192.168.192.10 kube-dns.kube-system.svc.cluster.local
nslookup: can't resolve 'nginx'
nslookup nginx.policy-demo.svc.cluster.local
Server: 192.168.192.10
Address 1: 192.168.192.10 kube-dns.kube-system.svc.cluster.local
Name: nginx.policy-demo.svc.cluster.local
Address 1: 192.168.204.48 nginx.policy-demo.svc.cluster.local
My /etc/resolv.conf is like this:
cat /etc/resolv.conf
nameserver 192.168.192.10
search policy-demo.svc.cluster.local svc.cluster.local cluster.local
options ndots:5
The text was updated successfully, but these errors were encountered: