The goal of this project is to understand UDP socket programing by developing a simplified DNS lookup client. You must create your own socket and cannot use any existing DNS library. You may use Python 3, Java, or C++/C as the programming language.
The DNS lookup client uses iterative queries to resolve a given domain name. It should start with the following command:
mydns(or java mydns or python mydns.py) domain-name root-dns-ip
Please make sure that your program name is exactly mydns. Submissions will be graded by a script. Other names will not be recognized, resulting in a zero score. where domain-name is the domain name to be resolved and rootdns-ip is the IP address of a root DNS server on the Internet. The list of current root
Your DNS lookup client should first query the specified root DNS server, which will return one or more intermediate DNS servers (in the Authority and Additional Information sections of the reply). Your client must automatically pick one intermediate server and query it. This process should continue until one or more IP address of the specified domain name are obtained (the IPs are in the Answers section of the reply). Then your DNS client should stop.
This DNS iterative resolution process is explained in Chapter 2.4 of the textbook, and is illustrated below.
The DNS message formats are explained in Chapter 2.4 of the textbook. To simplify the programming tasks, your DNS lookup client only needs to understand two types of resource records in the reply:
- NS, which means the record contains an intermediate name server for the domain name being queried. In this case, your client must also check the Additional Information section to find out the IP of the intermediate name server, in order to send a query to the server. If multiple intermediate name servers are included, your client only needs to pick one to query.
- A, which means the record contains the IP of the domain name being queried; your DNS client can stop once such a reply is received.
Your DNS lookup client should print all the intermediate results on the screen. For each iterative step, your client must clearly display the content of the reply message, and the
DNS server chosen to query next. A sample output is attached in the appendix.
You may focus on only IPv4 and ignore IPv6.
Verify the correctness of the lookup results by typing
nslookup domain-name 220.127.116.11
You can use Wireshark to analyze the DNS query sent by your program and verify if its format is correct.
- DNS RFC, http://www.ietf.org/rfc/rfc1035.txt
- DNS iterative resolution and message formats, Chapter 2.4 of textbook
You can either work in a group of up to three or independently. Only one submission is necessary for a group.
Host your code as a git repo at github.com, and invite the instructor [email protected] as a collaborator before submission. Group members with no commit record will receive a zero for the project.
Submit a copy of your final code to Canvas. (Source code only, no NetBeans/Eclipse project files)
Submit a readme.txt to Canvas with the following information:
- Member names and IDs
- GitHub link
- Language used: Python3/Java/C++/C
- Compiling instructions (not necessary for Python): command-line compiling instructions only, no NetBeans/Eclipse compiling.