This is the first project of Computer Network course. In this project we get familiar with DNS protocole and different records of that. Also we send some DNS queries to DNS severs and parse the answer we get from them.
This project has five different parts. The content of each part explain below but for complete explanation use this
In this part we bhave some questions to answer them like:
- What is the DNS protocol used for?
- What is the different DNS records and briefly describe each one.
- What is DNS Server and write addresses of three of the most popular DNS servers?
- What is the default port used in the DNS protocol?
- What is the structure of DNS packets?
- What is Socket?
The answer file is added in part1
In this section, we want to get acquainted with how to send a message on the network using python programming language.
- First we should create a socket.
- Send a message by specifying the specific DNS port and address of one of the DNS Servers.
- To ensure that the message is sent correctly, create a server socket in another application and send messages to it to see if your message was sent correctly in the specified port.
The related code is added in part2
- Receive an address name from the user as input and compose the message related to receiving the record A from this address name according to the answers in part 1. (You can assign multiple address names to a program in the form of a CSV file, and subsequently save the program output in this CSV)
- Parse the response received from the server in the program and display it if the IP address is found.
- You can get the type of record from the user and your program will be able to find other records in addition to the A record.
The related code is added in part3
As you know, DNS queries can work in either recursive or iterative ways. Its recursive model is such that if the server does not have the desired record, it will automatically find the record in relation to other servers and deliver it to you. Iterative type is such that the server does not have the record in question and gives you the address of another server to which you send your query. The purpose of this section is to handle the second case.
The related code is added in part4
Your application must have this feature that cash the resolve DNS in case of more than three times, and if the user wants to resolve a name for more than three times, the application is requested automatically from its cache memory.
The related code is added in part5