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

net: LookupSRV and search domains when name is empty #9391

Open
nikhilofthesouth opened this Issue Dec 19, 2014 · 6 comments

Comments

Projects
None yet
7 participants
@nikhilofthesouth

nikhilofthesouth commented Dec 19, 2014

Using Go 1.4 on Linux x86_64 (Ubuntu).

I called the lookupSRV function in the "net" package, with
lookupSRV("service", "tcp", "") (empty name).

I expected this to lookup using my search domains ("_service._tcp.my.search.domain"), but it potentially seems to have queried it with an extra "." ("_service._tcp..my.search.domain").

Is this intended? Or am I just using the function in a strange way? The workaround I'm using right now is to call lookupSRV("", "", "_service._tcp") instead.

@ianlancetaylor ianlancetaylor added this to the Go1.5 milestone Dec 19, 2014

@ianlancetaylor

This comment has been minimized.

Contributor

ianlancetaylor commented Dec 19, 2014

You are using the function in a strange way but I can't think of a good reason why it shouldn't work.
@mikioh

@minux

This comment has been minimized.

Member

minux commented Dec 19, 2014

We just need to add a special case for name=="" to src/net/lookup_*.go

@mikioh mikioh changed the title from LookupSRV and search domains when name is empty to net: LookupSRV and search domains when name is empty Dec 19, 2014

@zachgersh

This comment has been minimized.

zachgersh commented Jan 30, 2015

Have a change in review for this 😄
https://go-review.googlesource.com/#/c/3569/

@mikioh

This comment has been minimized.

Contributor

mikioh commented Feb 2, 2015

RFC 2782 clearly states that "Clients ask for a specific service/protocol for a specific domain (the word domain is used here in the strict RFC 1034 sense), and get back the names of any available servers." In mDNS, we use a new label "local." and in DNS-SD something more complicated. But those are requirements for protocols, not for built-in stub resolver implementation, API surfaces.

I wonder If we extend LookupSRV to be able to accept an empty string as a local domain or a wild card, what about other lookup APIs such as LookMX, LookupHost? Moreover, what if we extend both LookupSRV and LookupTXT to DNS-SD?

At this moment I have no concrete opinion on this issue, but fixing this issue with #8540 seems reasonable.

@zachgersh

This comment has been minimized.

zachgersh commented Feb 2, 2015

Hey @mikioh - thanks so much for the feedback (I also saw your comment on Gerrit). I wouldn't mind making these updates and solving #8540.

Would love to discuss some more details about the change you are suggesting (implementing DNS-SD) - maybe we move to an implementation discussion over on that issue?

@mikioh mikioh removed this from the Go1.5 milestone Feb 4, 2015

@rsc rsc added this to the Go1.5Maybe milestone Apr 10, 2015

@rsc rsc removed the repo-main label Apr 14, 2015

@gopherbot

This comment has been minimized.

gopherbot commented Apr 25, 2015

CL https://golang.org/cl/3569 mentions this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment