Skip to content

resolve PTR query (reverse lookup) to FQDN - #22

Open
lalyos wants to merge 1 commit into
gliderlabs:masterfrom
lalyos:ptr
Open

resolve PTR query (reverse lookup) to FQDN#22
lalyos wants to merge 1 commit into
gliderlabs:masterfrom
lalyos:ptr

Conversation

@lalyos

@lalyos lalyos commented Jan 30, 2016

Copy link
Copy Markdown
Contributor

Reverse lookups shoud probably resolve to the hostname, where the domain is included.

@lalyos

lalyos commented Feb 19, 2016

Copy link
Copy Markdown
Contributor Author

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.

@tilgovi

tilgovi commented Feb 19, 2016

Copy link
Copy Markdown

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 :).

@lalyos

lalyos commented Feb 20, 2016

Copy link
Copy Markdown
Contributor Author

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.

@tilgovi

tilgovi commented Feb 23, 2016

Copy link
Copy Markdown

This works great for me. Tested with --name (the .docker alias works unchanged) and --hostname with short and fqdn.

@tilgovi

tilgovi commented Feb 23, 2016

Copy link
Copy Markdown

@progrium?

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

Successfully merging this pull request may close these issues.

2 participants