3 ms·
Yes, but you still need to encode the questions and decode the answers. Existing libraries that do this are pretty dismal. (Dismal enough that I ended up writ
by spc476 11y ago
Yes, but you still need to encode the questions and decode the answers. Existing libraries that do this are pretty dismal.
(Dismal enough that I ended up writing my own DNS encoding/decoding library (https://github.com/spc476/SPCDNS https://github.com/spc476/SPCDNS) with the aim of being easy to use as well as safe. It assumes nothing about the incoming packet and does extensive validation (enough that it found bugs in other DNS libraries). It also avoids dynamic memory allocations. It's used at work in two projects that get heavy use (millions of DNS queries a day) and so far has performed without incident, so well written C code is possible.)