COSC 4377 - Introduction to Computer NetworksSpring 2012MW 1:00-2:30pm at PGH347
Homework 11 : DNS ServerDue: midnight April 18, 2012In this assignment, we will implement a DNS server. While a full-featured DNS server is a complex software, our DNS server only supports one type of query: A records. DNS protocolUnlike other protocols we have implemented in this course so far, DNS protocol uses binary format. What that means is you will not be able to print the messages transmitted and received as string to debug your implementation. Often you wil have to look at individual bits to understand the messages. When you are sending messages, you will have to set individual bits.A good place to start would be to read this RFC 1035 that describes the basic DNS names and protocols. Implementation GuideDNS server is a socket program that listens on a well known port (53). The clients that need to find an IP address for a name, send their request to the server running at that port. In response, the clients receive an answer from the server. In this assignment we will use the C programming language to implement our DNS server.Focus on understanding how an A record query is formatted. Once you understand that, you should be able to print the A record request. Specifically, you should be able to print the domain name in the query as string to the stdout of the server. For example, if we send a request to the server to find the IP address for "www.mysite.com", we need to first be able to correctly parse this name at the server. Once you know how to extract the name in the query, you need to learn how to send a response. You can read the RFC to understand how to format the response. TestingBecause you will be running your DNS server on the port you were assigned, we cannot use a standard DNS query. We need to send our DNS query to a server running at a specific port. The "dig" command allows you to specify the port number of the server. Learn how to use dig to send a query for a name to your DNS server. You can print the query name on the server.We will execute your DNS server as: ./dnsserver -pThe example above will launch the DNS server on port 10001. Your DNS server must return these IP addresses for these names:
Questions
SubmissionPlease include the source(s) and Makefile in a folder with the name: uhid_hw11, where uhid is the prefix of your .uh.edu email address. Then, zip the directory and upload the zip file using Blackboard. Your program must compile and execute on bayou. |