This project provides a simple DNS client in Python that sends a DNS query to a server and prints the response in a format similar to nslookup.
- Constructs a DNS query following RFC 1035.
- Supports decoding A and CNAME records.
- Pretty-prints the response with server info and answer details.
- Provides helpful usage instructions and troubleshooting tips.
- dnsClient.py: The main Python script that builds, sends, and parses DNS queries.
- Python 3.x
Run the script from the command line:
python dns_client.py <hostname> [<dns_server>]
- Without
dns_server, the program will query the local router. I suggest testing with 1.1.1.1 or 8.8.8.8 as this parameter.