A DNS server that is capable of responding to A type DNS queries on the server where it is deployed. By running this server, you have the ability to create and manage your own DNS mapping, allowing you to customize and control the resolution of domain names to IP addresses.
Put your DNS records in the /etc/hosts
file. Open the file using a text editor and add entries in the format:
<IP Address> <Domain Name>
For example:
192.168.1.100 example.com
192.168.1.101 subdomain.example.com
Execute the ClientHandler.py file using Python. Open your terminal and navigate to the directory where the file is located. Run the following command:
python ClientHandler.py
. The DNS server is now listening on port 5353 UDP.
. Ensure that no other application is using the same port to avoid conflicts.
You can test the DNS server by querying it using a tool like dig or nslookup. For example:
dig @127.0.0.1 -p 5353 example.com