Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
net: LookupSRV and search domains when name is empty #9391
Using Go 1.4 on Linux x86_64 (Ubuntu).
I called the lookupSRV function in the "net" package, with
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
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.
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?