Open lalyos opened 8 years ago
You can test this PR applied to resolvable as lalyos/resolvable:fqdn-ptr
$ docker run -d \
--hostname resolvable \
-v /var/run/docker.sock:/tmp/docker.sock \
-v /etc/resolv.conf:/tmp/resolv.conf \
lalyos/resolvable:fqdn-ptr
and than start a fqdn container:
$ docker run -it --hostname=myhost.example.com gliderlabs/alpine:3.3 sh
# apk add -U bind-tools
# dig +short myhost.example.com
172.17.0.3
# dig +short -x 172.17.0.3
myhost.example.com.
Only question I have is whether it's possible that the container domain name is empty, and then does the trailing .
break anything?
Other than that, seems fine to me, although I admit I don't understand why this makes PTR work :).
reverse lookups (PTR records) is already working, it just resoles to the short name. This PR is about resolving reverse lookups to fqdn instead of short hostname.
So right nowit works like this:
# dig +short myhost
172.17.0.3
# dig +short -x 172.17.0.3
myhost.
The trailing dot is actually how PTR-s are working, so it doesnt break anything.
This works great for me. Tested with --name
(the .docker alias works unchanged) and --hostname
with short and fqdn.
@progrium?
Reverse lookups shoud probably resolve to the hostname, where the domain is included.