dns icon indicating copy to clipboard operation
dns copied to clipboard

PTR RR contains backslash before space charactars within mDNS messages

Open DAMEK86 opened this issue 1 year ago • 0 comments

hey, first of all create lib!

while working with zeroconf, I figured out that the following Ptr field contains additional \ characters before each space character.

// PTR RR. See RFC 1035.
type PTR struct {
	Hdr RR_Header
	Ptr string `dns:"cdomain-name"` <----
}

therefore I sniffed the mDNS package with wireshark to be sure that the \ character is not sent by the sender.

as u can see in the picture there is no \ character in the payload itself. image

however, if i printout the Answer section of the msg struct, i get the following

[_ship._tcp.local.      4500    IN      PTR     KOSTAL\ Smart\ Energy\ Meter\ G2._ship._tcp.local. KOSTAL\ Smart\ Energy\ Meter\ G2._ship._tcp.local. 4500    CLASS32769      TXT     "model=KSEM-G2" "type=hw0200" "brand=KOSTAL" "ski=0ef1d56380ef0db6464ea97ca76d1c5a4cce1b0a" "register=false" "path=/ship/" "id=KSEM-76420087" "txtvers=1" KOSTAL\ Smart\ Energy\ Meter\ G2._ship._tcp.local.        120     CLASS32769      SRV     0 0 16369 KSEM-76420087.local. KSEM-76420087.local.   120     CLASS32769      AAAA    fe80::2d0:93ff:fe5a:b6bc KSEM-76420087.local. 120     CLASS32769      A       192.168.178.78]

my question is if u see a chance to somehow disable this character adding for mDNS entries. This would would be great. Andreas

CC @DerAndereAndi

DAMEK86 avatar Oct 01 '24 20:10 DAMEK86