ECE4016 Assignment 1
In this assignment, you are required to implement a simple Local DNS Server .
Introduction
The Domain Name System (DNS) is the hierarchical and decentralized naming system used toidentify computers reachable through the Internet or other Internet Protocol (IP) networks. Theresource records contained in the DNS associate domain names with other forms of information.These are most commonly used to map human-friendly domain names to the numerical IPaddresses computers need to locate services and devices using the underlying networkprotocols, but have been extended over time to perform many other functions as well. TheDomain Name System has been an essential component of the functionality of the Internet since(wikipedia)
Iterative query and Recursive query
Detailed grading rule
The local DNS server should have the following function:Listen and accept the DNS queries
Send response to the clientsMaintain a cache(20 points). If the ip address is queried before, it should be stored in thecache. if the answer for the query is found in cache, Local DNS Server send this answer toClient as the DNS DAI 寫 ECE4016 A simple Local DNS ServerresponseSupport the DNS queries of www.baidu.com through recursive or iterative searching (30points)Support the DNS queries of www.example.com through recursive or iterative searching (20 points)Support the DNS queries of www.baidu.com through public DNS server (15 points)Support the DNS queries of www.example.com through public DNS server (15 points)
Requirements
Print the ip address of all the servers you pass by during the searchingUse a variable flag to indicate whether ask the public server for the IP address. When theflag is set to be 0 , ask the public server for the IP address. When the flag is set to be 1 dothe recursive or iterative searchingMake sure your program works underubuntu 20Show how to execute your codeThe programming language should be Python(version 3.9)Dnspython is not allowed to use in this labThe server is required to work on port 1234 of 127.0.0.1
Useful tools
There are some useful tools that may help you in your programming. (Dnspython is not allowedto use in this lab)socketdnslibSimple test by yourself You can use dig to test your local NDS server.An example test code:
dig www.example.com @127.0.0.1 -p 1234
dig www.baidu.com @127.0.0.1 -p 1234
Note that this test code will be used in the evaluation of this project, make sure your programworks given this test code.
Submission
Due on 23:59, 13 Oct 2024(Late submission within 5 minitues is allowed withoutpunishment)
Every 24h late delivery will be deducted 10%, and 48h late delivery will be allowed at most.After 48h, 0 marks will be given for this assignment
Honesty We take your honesty seriously. If you are caught copying others' code, you will get anautomatic 0 in this project. Please write your own code.