Skip to content
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: dnsMsg.Pack() doesn't support compression #15954

Closed
iangudger opened this issue Jun 4, 2016 · 1 comment
Closed

net: dnsMsg.Pack() doesn't support compression #15954

iangudger opened this issue Jun 4, 2016 · 1 comment

Comments

@iangudger
Copy link
Contributor

RFC 1035 specifies (among other things) two requirements for DNS packet transport and parsing:

  • All DNS packet parsers must accept compressed packets
  • DNS packets sent over UDP cannot be larger than 512 bytes

Supporting compression is optional on the packet building side, but not supporting it often results in packets larger than 512 bytes. Long domains and domains with lots of records are common, so not supporting compression often results in DNS packet corruption when using UDP because most DNS implementations (including the one in this package) will only read the first 512 bytes.

@mdempsky
Copy link
Member

mdempsky commented Jun 4, 2016

This is intentional: dnsMsg.Pack is only used (aside from tests) for encoding single-question query packets, which aren't compressible anyway.

@mdempsky mdempsky closed this as completed Jun 4, 2016
@golang golang locked and limited conversation to collaborators Jun 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants