Question: Implement a Local DNS server using UDP in python Local DNS sever has two major roles (1) Acts as proxy, forwards query into DNS server

Implement a Local DNS server using UDP in python

Local DNS sever has two major roles

(1) Acts as proxy, forwards query into DNS server hierarchy (recursive)

Hint: use gethostbyaddr.c in dns directory

(2) local cache;

Cache entries in a DNS server is valid only for 10 seconds as TTL

Note: Actual TTL in Local DNS should be 2 days

Hint: use gettime.c in dns directory

Cache can contain up to 5 lists

OUTPUT FORMAT:

Server:

./udpserver 7123 (enter)

server received datagram from (147.97.156.240)

Server received 15/15 bytes: 147.97.50.204

Server has no 147.97.50.204 in a cache

Server requests to the DNS server

Server gets hostname address (www.google.com)

Server saves www.google.com 147.97.50.204 in cache

Server sends www.google.com to the client

Client: (requests hostname)

./udpclient ipaddress 7123

Please enter host or IP: 216.58.194.100

Hostname: www.google.com

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!