A DNS query and response parser that I made for a class. It sends a DNS query to a specified server and parses the binary data for the answers and then displays it. It has error handling for malformed packets.
To use, provide either a domain name or an IP address for lookup and the DNS server you wish to contact as command line arguments.
Certain portions of the code were gotten from the homework assignment:
- The
#define's - The
make_dns_quersionfunction - The high level structure of the
udp_send_receivefunction9
Everything else was created by me, such as the error handling, main function, and response parsing.