DNS server Project

From COEP Wiki
Jump to: navigation, search

Connection Timeout

The timeout set by the user can be set in the code using .timeout() function for the socket variable.

ptr Query Type

Reverse DNS lookups use the special domain in-addr.arpa for IPv6 and ip6.arpa for IPv6. For reverse queries, the IP address in the query must be reversed and the respective domain must be appended to it before sending the query to the server. For converting the IP addresses to their expanded form .exploded from the ipaddress library can be used

DNS Cache

The DNS server cache can be implemented in the form of a text file containing a list of tuples storing query, response, time to live(ttl) and entry time. The entry time can be easily found using the time module. When the server program is run, the expired entries can be deleted before accepting queries from the client. Before sending an entry from the cache to the client, the ttl must be verified once so as not to send an expired entry. Only if the answer is not found in the cache, the server should send a query to further servers(hence the server acts a both, a server and a client).