potentialstyx's comments

potentialstyx | 1 year ago | on: IANA's List of Domain Name System (DNS) Parameters

> "Let's build a DNS parser that's spec compliant" is something that only insane people would say. I dare to argue it's an impossible task at this point.

Having worked on a toy RFC1035 DNS parser from scratch (I had written a DNS server once before, but I wouldn't even consider it a toy server) over the last few months[0], I can agree that it would be a very hard task to write a fully spec compliant DNS parser, but not that it would be anywhere near impossible. Documentation is scarce, but if you look hard enough it can be found. Finding out whats been deprecated does require reading a lot of RFCs but the IETF Datatracker site makes it easy to find any of those update RFCs and errata.

While I didn't implement parsers for that many individual RR types a lot of them could be reused, since many RR types share the same format. Also if you are just writing a recursive resolver then you don't really need to actually parse every kind of RR type, you can just blindly forward most of them. Dealing with malformed/truncated packets is a pain to figure out, but not that hard to do, in my opinion, once you think over all the possible ways a packet could be malformed.

Seeing how Ladybird[1] has basically proven the "Building a browser from scratch is impossible" crowd wrong, I'm sure that some project could come around and do the same for DNS.

[0] https://github.com/PotentialStyx/dns-server

[1] https://ladybird.org/

page 1