Coding with the DNS protocol v2 – Includes DNS basics, How to decode DNS packets by hand, Parsing DNS replies, advanced DNS techniques, and DNS Security Mechanisms. Well written, contains lots of in depth information and example code.
You can download it from the following link: https://packetstormsecurity.com/files/download/23111/coding-with-the-dns-protocol.txt
Source: https://packetstormsecurity.com/files/23111/coding-with-the-dns-protocol.txt.html