vpnkit
vpnkit copied to clipboard
Mac host resolver erroneously resolves short names
If /etc/resolv.conf has something like:
domain my.domain
and there exists a name foo.my.domain then
$ docker run -it centos:7 ping foo
ping: foo: Name or service not known
but
$ docker run -it alpine ping foo
PING foo (1.2.3.4): 56 data bytes
64 bytes from 1.2.3.4: seq=0 ttl=37 time=0.547 ms
^C
--- foo ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.547/0.547/0.547 ms
The query from the VM is for the short name foo but the answer comes back for foo.my.domain. The alpine resolver accepts it but the glibc one does not.
We should return a failure rather than an answer for a different question. (Separately we should ensure that the domain of the VM is set correctly so that the VM follows up with better questions)