You may do this assignment in groups of up to three.
This assignment improves the dns client of Assignment 4. Assignment 4 required you to work individually. For this project, you may improve the dns client of any member of the team, or create a merged dns client based on the code from one or more members of the team. You cannot use dns code from anybody who is not on your team.
Create your simple DNS client, called dns.c, as explained in the previous paragraph.
Now improve the DNS client to receive the response from the server and print it, using the print_buffer from Assignment 3.
Now add a call to alarm so your client exits if no response is received within 5 seconds. You can test this by specifying an IP number for a host that doesn't provide DNS service.
Now add a call to sigaction so your client prints an appropriate message when alarm goes off, i.e. if the server does not respond. Turn in your code for this improved client
This client sends requests for the AAAA record of the given domain name, and prints the result as in these examples:
www.hawaii.edu: AAAA <none>
hawaii.edu: AAAA <none>
ietf.org: AAAA 2001:1900:3001:11::2c
IPv6 addresses can be printed using inet_ntop, with AF_INET6 as the first parameter and the sin6.sin6_addr.s6_addr as the second parameter.
To do this project, you will have to study the RR format given in the lectures. Your code will have to handle domain name label pointers. Further information for resource records is available from RFC 1035, and for AAAA records in RFC 3596.
Turn in your code for this full client.
You are welcome to check your results using wireshark and dig.