paulc / dnslib

A Python library to encode/decode DNS wire-format packets
https://github.com/paulc/dnslib
BSD 2-Clause "Simplified" License
295 stars 84 forks source link

DNS SRV "target" names are compressed #66

Open bobstanden opened 1 week ago

bobstanden commented 1 week ago

DNS SRV RR should not be compressed.

From RFC2782, page 3:

Target The domain name of the target host. There MUST be one or more address records for this name, the name MUST NOT be an alias (in the sense of RFC 1034 or RFC 2181). Implementors are urged, but not required, to return the address record(s) in the Additional Data section. Unless and until permitted by future standards action, name compression is not to be used for this field.

The correction is at line 1457 of dns.py: buffer.encode_name_nocompress(self.target)

and, for completion, to comment at line 297 of label.py: (needed for RRSIG, SRV)

bobstanden commented 1 week ago

I have raised this issue also in dnslib3