

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Distributed Operating Systems course is designed to examine the fundamental principles of distributed systems, and provide students hands-on experience in developing distributed protocols. This assignment includes: Dns Resolver, Dns Error, Requirements and Restrictions, Code, Java Code, Ns Server, Iterative
Typology: Exercises
1 / 3
This page cannot be seen from the preview
Don't miss anything!


The goal of this assignment is to implement a DNS resolver. The DNS resolver takes a hostname as an input and issues a series of iterative queries to obtain the IP address (A record) for the hostname. For example, C:>myresolver cse.unl.edu cse.unl.edu A = 129.93.165.
Your resolver must also be able to follow aliases (CNAME records) to obtain the IP address of the hostname. A sample output is, C:>myresolver www.cse.unl.edu www.cse.unl.edu A = CNAME to cse.unl.edu cse.unl.edu A = 129.93.165.
If a hostname does not exist or does not have an A record, your resolver should indicate that. For example, C:>grads.cse.unl.edu grads.cse.unl.edu A = does not exist
Normally there are several redundant servers for each DNS zone. If one server is down or has other problems, you should try a different server. Only if none of the servers are responsive can you report a DNS error. There are a large number of DNS resource record types. Your code is required to support queries for A records. In order to do this, your resolver will also need to understand the following DNS resource record types. CNAME records. When resolving CNAME records, your code must continue to follow the CNAME chain until it either finds an IP address at the end of the chain or proves that the CNAME chain is misconfigured (that is, the chain of CNAMEs leads to a hostname that does not exist or the chain leads to a loop). SOA records. SOA records are sent to indicate a requested name does not exist. NS records. NS records identify servers to ask and your code must start from a DNS root server and follow a chain of NS records until you find the NS server
with the desired result. Refer to RFC 1035 for more information about these DNS resource record types.
Programming Requirements and Restrictions
You could use either Java or C/C++. Your resolver may issue only iterative queries. You configure your resolver with the IP addresses of the DNS root servers. To obtain a list of root servers, try the command “dig. NS”. The purpose of this assignment is for you to develop DNS resolver code. You must create your own DNS packets, open your own sockets, send your own query packets, and listen for response packets. It is NOT acceptable to call DNS library functions. For example, Java code must not use functions like InetAddress.getbyname() and C code must not use functions like gethostbyname(). Since you are only allowed to send iterative DNS queries, your resolver will likely need to start by sending a query to a root server. RFC 1035 describes the byte format of a DNS query message.