Closed jiangzhuti closed 5 years ago
Not sure if I fully understand your proint. Could you provide more details (e.g. fragment of code and error output), please?
Not sure if I fully understand your proint. Could you provide more details (e.g. fragment of code and error output), please?
if domain name end with '.'(for example, "abc.com."), then https://github.com/mnezerka/dnslib/blob/master/src/buffer.cpp#L410 will take true branch ,the result dns packet is like this: "0x03 0x61 0x62 0x63 0x03 0x63 0x6f 0x6d 0xc0 0x00", 0xc0 is unwanted.
I tried it and from my experiments, it seems that Buffer::putDnsDomainName("abc.com.")
generates this:
0x03 0x61 0x62 0x63 0x03 0x63 0x6f 0x6d 0x00 0x00
, so the dot at the ends generates one additional empty label. As I understand, it is unwanted. I'll prepare fix which will ignore dot at the end.
I addressed this issue in a55c42aaf4926684029fac47f37293fc5f342d0b. I hope it is solved.
e.g.
Buffer::putDnsDomainName("abc.com.")
dig
could properly handle this