A lightweight DNS resolver implementation in C that performs IPv4 (A) and IPv6 (AAAA) record lookups
This DNS resolver implements basic DNS query functionality by:
- Building and sending DNS queries to a DNS server (Google DNS - 8.8.8.8)
- Parsing DNS responses including A, AAAA, and CNAME records
- Supporting both IPv4 and IPv6 address resolution
- GCC compiler
- Make build system
- Linux/Unix environment (for socket programming)
- Clone the repository
git clone <repository-url>
cd dns-resolver
- Build the project
make
- Run the resolver
./bin/dns_resolver <domain-name>
- Uses UDP for DNS queries (port 53)
- Maximum packet size: 512 bytes (standard DNS)
- Supports DNS name compression
- Handles multiple answers per query
./bin/dns_resolver www.github.com
Response ID: 1234
Answer Count: 2
IPv4 Address: 140.82.121.4
IPv6 Address: 2a00:1450:4009:822::2004