-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: cannot resolve SRV records with compressed targets #36718
Comments
That's pretty unfortunate that Samba doesn't follow the RFCs. Considering that oddity, I am not sure if this belongs in the core library or its own package. The owners should have a better idea. /cc @mikioh @bradfitz @ianlancetaylor |
/cc @mdempsky |
RFC 2782 clearly states "name compression is not to be used for [SRV's Target] field." RFC 3597 though states we "SHOULD" support decompressing names in SRV RRs (as opposed to "MUST" for the RRs where we already support decompression). I'd review a patch to enable decompression (but not compression) of SRV targets if someone wants to work on one. I think Samba should fix their behavior though. |
I agree Samba should fix this, but it is but one example of an embedded server in the wild, and there is no good reason for a client to fail. Commit 24dd3780ca4f75fed9f321890729414a4b5d3f13 explicitly did this, which IMO, should be reverted. |
I don't see that commit in Go's git history? |
Ah, thanks. That looks safe to revert. I'd appreciate some confirmation that other major DNS clients are today accepting SRV RRs. (I assume they are, otherwise I'd expect more pushback against Samba doing this.) |
ISC's BIND at the very least does, as dig has no problem resolving these records. This is a common reference implementation. |
Okay, reverting that CL seems fine to me then once the trees open up again for development. Thanks. |
We have a number of users hitting this issue when using SRV records with the |
Apple's vmnet framework runs a DNS server at the gateway address which seems to have this same behavior. Running a macOS guest with this interface (specifically, under
|
Change https://go.dev/cl/442255 mentions this issue: |
This networking mode, which uses a virtualization networking API from Apple, appears to be more stable than the default userspace networking. Multiple guests will share the same subnet, so they must have different MAC addresses. Apple's API seems to run an DNS server that serves compressed SRV records, which Go does not support (golang/go#36718) and thus causes a net test to fail. Until that is resolved, we must manually specify a custom DNS server. For golang/go#48945. Updates golang/go#36718. Change-Id: Ibc5b91ed1456d1364975febe83fd282c42bd6ed1 Reviewed-on: https://go-review.googlesource.com/c/build/+/442255 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Jenny Rakoczy <[email protected]> Run-TryBot: Michael Pratt <[email protected]>
Change https://go.dev/cl/540375 mentions this issue: |
As per RFC 3597: Receiving servers MUST decompress domain names in RRs of well-known type, and SHOULD also decompress RRs of type RP, AFSDB, RT, SIG, PX, NXT, NAPTR, and SRV (although the current specification of the SRV RR in RFC2782 prohibits compression, RFC2052 mandated it, and some servers following that earlier specification are still in use). This change allows SRV resource decompression. Updates golang/go#36718 Updates golang/go#37362 Change-Id: I473c0d3803758e5b12886f378d2ed54bd5392144 GitHub-Last-Rev: 88d2e06 GitHub-Pull-Request: #199 Reviewed-on: https://go-review.googlesource.com/c/net/+/540375 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Carlos Amedee <[email protected]> Auto-Submit: Damien Neil <[email protected]> Reviewed-by: Damien Neil <[email protected]>
As of https://go.dev/cl/570156 this is now fixed. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Samba (at least 4.3.11-Ubuntu), compresses the Target fields of the SRV records. While this is against clarifying RFCs and there is much discussion of this in the patch enforcing this, it breaks resolver behavior at least against Samba and possibly other embedded servers.
IMO, this makes the resolver less robust. If the rationale is to defend against ignorant DNS proxies, I would argue the client is not the layer to make this decision.
What did you expect to see?
successful resolution
What did you see instead?
error "cannot unmarshal DNS message"
The text was updated successfully, but these errors were encountered: