3 ms·
Do you mean the binary message format or something higher level? I’ve got a little DNS client/server library in Go [1], and I’m curious whether there’s a minim
by olowe 2y ago
Do you mean the binary message format or something higher level?
I’ve got a little DNS client/server library in Go [1], and I’m curious whether there’s a minimal subset of the binary format I could handle myself so my library only depends on the Go standard library. Any tips?
[1]: https://pkg.go.dev/olowe.co/dns https://pkg.go.dev/olowe.co/dns
- bhaney 2y agoYeah, I mean the binary message format. It's not particularly complicated to parse if you don't care to handle all the custom logic for each RRTYPE. You parse a fixed size header, one section with a couple fields, and up to three more sections that all have the same format. The most annoying part of the core format to implement is probably message compression, but it's fairly straightforward too as long as you're keeping the entire original message around for the duration of the parsing. I'd say just skim RFC 1035 section 4 and take a crack at it. It's a fun exercise if nothing else.