The DNS Resolver Server project is a lightweight DNS server implementation designed to resolve DNS queries via UDP. It provides a simple yet efficient way to handle DNS requests from clients and send back responses with resolved DNS records.
-
UDP-based DNS Resolution: The server listens for DNS requests over UDP, making it suitable for quick and lightweight DNS resolution tasks.
-
System-Configured Resolver: Utilizes the system-configured DNS resolver to perform DNS queries, ensuring compatibility with various DNS configurations.
-
Support for Multiple Record Types: Supports resolution of various types of DNS records, including "A", "AAAA", "MX", "CNAME", "TXT", and more.
-
Error Handling: Handles DNS resolution errors gracefully, providing informative messages in case of failures or timeouts.
-
Flexible Configuration: Easily configurable server settings, such as the server IP address and port number, allowing for customization based on deployment requirements.
-
Parallel Processing: It implements parallel processing making the service highly scalable as the hardware spec are increased.
The DNS Resolver Server project is particularly useful in scenarios where a lightweight DNS resolution solution is needed, such as:
- Local network DNS resolution for internal services and resources.
- DNS resolution for small-scale applications and services where a full-fledged DNS server may be overkill.
- Educational purposes, allowing users to understand the basics of DNS resolution and server-side network programming.
- Python: The server implementation is written in Python, leveraging its simplicity and versatility for network programming tasks.
- dns.resolver: Utilizes the
dns.resolvermodule from thednspythonlibrary for performing DNS queries. - Socket Programming: Implements UDP socket programming in Python to handle communication between the server and clients.
- TCP Support: Extend the server to support TCP-based DNS resolution for handling large DNS responses and zone transfers.
- Cache Implementation: Implement a caching mechanism to store resolved DNS records temporarily, improving response time for frequently requested records.
- Security Measures: Introduce security features such as DNSSEC support and filtering capabilities to enhance the server's reliability and security.
- move into bharatdns folder
- run the server file
python main.pyIt will install all required dependencies.
- If an Error occurs for enabling long paths in Windows 10/11, then you need to update your Registry file (.reg)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"LongPathsEnabled"=dword:00000001
- for this, you can open
Powershellin Administrator mode and run followinf command
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force- and run
python ./main.pyagain
It will promt to enter email id and password. Then, It will start a udp server on your PC.
Now, use any other device on same network to make a dns query
For Windows:
nslookup google.com 192.168.1.2where 192.168.1.2 must be replaced by your server PC's IP.
For Mac/Linux:
dig @192.168.1.2 google.comwhere 192.168.1.2 must be replaced by your server PC's IP.
Please refer to this video for a complete step by step demonstration - https://www.youtube.com/watch?v=MPd8maJ8cZQ
- One more thing, after making the video I added twitter in blacklist so, you might not able to visit twitter
If you want to see a frontend, here it is
The frontend is an admin Live Monitoring dashboard.
- Sarthak Gupta - 2022BCY0054 - sarthak22bcy54@iiitkottayam.ac.in
- Dhanush Hebbar - 2022BCY0021
- Arjun R. Nair
- Rohit Reddy
