Homework 4: Recursive DNS server

Your goal is to recreate the functionality of a recursive DNS resolver. Your program will not be allowed to perform any recursive queries (i.e. request that another server perform recursion for it); it must perform all recursion itself.

You can install a “reference” recursive dns server using the script in recursiveresolver.tgz within the utils/ directory of the public git repository. You can install it the same as you installed the vpn during homework 1: untar the file (tar xvf recursiveresolver.tgz), cd into the directory that created (cd recursiveresolver), and run the install script as root: sudo ./install.sh. This will install a recursive DNS resolver to run on the local machine and listen for new requests on port 5656. Your job is to recreate its functionality for the below classes of testcases.

The output of dig @localhost -p 5454 $QUERY (with your code listening for new requests on port 5454) will be compared against running dig @localhost -p 5656 $QUERY, with output line order and Query ID not important.

You may program this assignment in the language of your choice. C and Python skeleton files are provided in the public git repository. As a significant amount of work is done in the skeleton files, I highly recommend using them for this assignment.

The skeleton files are hard coded to query a root nameserver. Because these servers will not perform recursion, they will simply give back the first step toward finding the final answer you seek.

The file root-servers.txt has been provided as a list of recursive root nameservers. These are the servers you should contact first when conducting your recursive name resolution.

  • 10 points: perform A record lookups without querying a recursive nameserver
    • +2 points: …and CNAME restarts (e.g. www.internic.net)
    • +2 points: …and “unglued” nameservers (e.g. www.yahoo.com.tw)
    • +1 points: perform queries against nameservers only available via IPv6 (e.g. ds.v6ns.test-ipv6.com)
  • 10 points: cache answers and immediately respond to users with the cached version ONLY when it exists in the cache, and provide a correct TTL.
    • +2 points: …cache and return intermediate results as well.
  • 10 points: service multiple requests simultaneously (as in hw3)
  • 5 points: timeout and retry any unanswered/incorrectly answered queries after 3 seconds
    • +2 point: …and retry on alternate servers
    • +1 point: …and send a SERVFAIL response when all alternative servers have failed

This homework will be graded out of 25 points. Any points above 25 will be considered extra credit. Hint: keep your working commits on the master branch, and work on separate branches to get different features working correctly.

Your code should be on the master branch in the subdirectory hw4. It will be graded by invoking hw4.sh -p PORTNUM. If your language of choice needs to be compiled, make sure that the Makefile has been updated to satisfactorily to compile your code.

All code will be inspected to ensure that no DNS related libraries have been used. If in doubt, ask: using a DNS library (or code that is not yours) will be considered cheating.

This assignment is due October 14 at 3pm. GET STARTED EARLY. I’m giving you 2.5 weeks because you need 2.5 weeks.

helpful links:
tcp ip guide
iana dns parameters