Closed femtoeu closed 1 year ago
panic: runtime error: index out of range [201] with length 9
goroutine 852 [running]: github.com/phuslu/fastdns.(*Message).DecodeName(0xc00f291260, {0x0?, 0x0, 0x7a4a58?}, {0xc0037f352b, 0x9, 0x5cc46c?}) /root/go/pkg/mod/github.com/phuslu/fastdns@v0.8.1/message.go:201 +0x431
req, resp := fastdns.AcquireMessage(), fastdns.AcquireMessage() defer fastdns.ReleaseMessage(req) defer fastdns.ReleaseMessage(resp) req.SetRequestQustion(domain, fastdns.TypeMX, fastdns.ClassINET) err := fastdnsClient.Exchange(req, resp) if err != nil { log.Println(err) return "", "", err } var hosts []string _ = resp.Walk(func(name []byte, typ fastdns.Type, class fastdns.Class, ttl uint32, data []byte) bool { if typ == fastdns.TypeMX { hosts = append(hosts, string(resp.DecodeName(nil, data[2:]))) } return true })
Could you please give me the domain of MX, if confidential, can mailto me.
i cannot reproduce it with same domain. I think this is a DNS server issue
panic: runtime error: index out of range [201] with length 9
goroutine 852 [running]: github.com/phuslu/fastdns.(*Message).DecodeName(0xc00f291260, {0x0?, 0x0, 0x7a4a58?}, {0xc0037f352b, 0x9, 0x5cc46c?}) /root/go/pkg/mod/github.com/phuslu/fastdns@v0.8.1/message.go:201 +0x431