1. 16
  1.  

  2. 4

    The devil’s in the detail and there are plenty of places where you can mess up (as I found out writing my own DNS encoder/decoder). The author briefly mentions the domain name encoding scheme when decoding, but if you blindly assume valid data, you could end up in an infinite loop. Another issue I found out the hard way—I have yet to find a nameserver that actually supports multiple questions. The spec allows it, but I’ve yet to find a server that can handle it (which is a shame, since it could be used to reduce DNS queries).