go: net: go 1.11 DNS client incompatible with SRV records from kube-dns

What version of Go are you using (go version)?

go1.11

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

linux amd64

What did you do?

Running the following application in Kubernetes exits with an error:

https://play.golang.org/p/EW5NVeHJMrV

What did you expect to see?

Expected to get SRV records back

What did you see instead?

When running in Kubernetes with kube-dns 1.14.10 the application exits with error: “cannot unmarshal DNS message” (underlying error is “Target: compressed name in SRV resource data”)

https://play.golang.org/p/EW5NVeHJMrV

A pcap of the DNS request: https://github.com/jnewmano/kube-dns/blob/master/dns_111_2.pcap

When built with Go1.10, it behaves as expected.

Golang-nuts discussion https://groups.google.com/forum/#!searchin/golang-nuts/dns|sort:date/golang-nuts/vAbjprJNPV0/HSh9635hBQAJ

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 16 (9 by maintainers)

Most upvoted comments

I also think behavioral difference with dig should be taken into account

For what it’s worth, the reason I requested to file this issue is that I guess this could be a roadblock for operating DNS-SD in near future. Nowadays DNS-SD is becoming important not only for consumer plug-and-pray-or-play use but for label distribution over unicast DNS with k8s-like scheduler stuff. As described in RFC 8222, we still don’t see the end of the label handling conflict between classical/conventional unicast DNS, and latest unicast and/or multicast DNS and DNS-SD, but need to find out a comprimise for both use cases.

One easy option would be just adding a control knob to net.Resolver and x/net/dnsmessge package without changing the current defaut, classical/conventional unicast DNS, behavior in the net package of standard library (see also #24870).