Closed mattias-p closed 6 months ago
When I run this program I get the following output.
package main import ( "fmt" "github.com/miekg/dns" ) func main() { rr, err := dns.NewRR(". 4294967295 IN NS") if err != nil { panic(err) } fmt.Printf("%s\n", rr) buf := make([]byte, dns.Len(rr)) n, err := dns.PackRR(rr, buf, 0, nil, false) if err != nil { panic(err) } fmt.Printf("%v\n", buf[0:n]) }
. 4294967295 IN NS [0 0 2 0 1 255 255 255 255 0 0]
The call to NewRR happily returns an NS RR with empty RDATA. I would have expected NewRR to return an error instead. Is this behavior intentional or is it a bug?
except this isn't invalid if you take dynamic updates into consideration
Good point. Thanks for clarifying.
When I run this program I get the following output.
The call to NewRR happily returns an NS RR with empty RDATA. I would have expected NewRR to return an error instead. Is this behavior intentional or is it a bug?