dog icon indicating copy to clipboard operation
dog copied to clipboard

valid TXT answer is considered invalid

Open hanickadot opened this issue 3 years ago • 2 comments

Hi,

I was told about your awesome utility and I really like it. Yesterday I noticed probably a bug, when I tried this query:

dog 24yzjhop3iawhkuxy4b3yj36dogrbkwwz2xivaujzqzeyiwobz2a.luna.avast.com. TXT

This query returns two TXT record, one is 53 bytes long and other exactly 255.

The utility returns error: Error [protocol]: Malformed packet: insufficient data (latest GIT master 721440b12ef01a812abe5dc6ced69af6e221fad5) or once I got: Error [protocol]: Malformed packet: length 256 was specified, but read 257 bytes (with dog v0.1.0)

I'm using dog on Mac OS 12.5 on Arm.

I believe the error is associated with this piece of code:

https://github.com/ogham/dog/blob/master/dns/src/record/txt.rs#L45

As one of the records is exactly 255 bytes long. And there is no other piece of it. The record is persistent so you can try on your own.

Thanks!

hanickadot avatar Aug 04 '22 04:08 hanickadot

I have the same problem on macOS. Simple example:

$ dog dropbox.com TXT
Error [protocol]: Malformed packet: length 345 was specified, but read 255 bytes

I assume this is because one of the spf TXT records exceeds 255 bytes. However, as long as no single string in quotes exceed 255 bytes then it's still in spec. In my example case, the spf record has a 254 byte and a 89 byte string. Dig works fine: dig dropbox.com TXT

varenc avatar Dec 03 '22 03:12 varenc

I have a smilar problem: Screen Shot 2023-03-02 at 13 41 17

dog fails to get TXT for google._domainkey.redsift.com while dig succeds

Looks like a lack of support for split TXT records for me

pietrzakacper avatar Mar 02 '23 12:03 pietrzakacper