How manoj-kr24/domain-name-system works
Project type and purpose
• This is a Python-based client-server DNS simulation tool with three primary roles:
• DNS Server (dnsServer.py) – hosts and resolves records
• DNS Client/Resolver (resolver.py) – sends lookup queries
• DNS Manager (dnsManager.py) – adds/removes records
• It uses plain‐text files (domains_databaseIPV4.txt, domains_databaseIPV6.txt) as persistent storage of DNS records.
File structure
• Top level:
• dnsServer.py – server process listening on a socket, loading/storing the “DNS tree”
• resolver.py – client process issuing queries over sockets
• dnsManager.py – client/process issuing management commands
• domains_databaseIPV4.txt & domains_databaseIPV6.txt – backing stores for A and AAAA records
• README.md – project description and usage
• No hidden subdirectories or microservices: a classic single‐node client‐server application.
README for additional insights
• Networking via Python’s socket library
• In-memory DNS tree built on startup from the text files
• Supports add/remove operations by the manager, which updates both in-memory tree and text file
• Future enhancements: caching, error handling, GUI
a. Main components to show:
• DNS Client/Resolver
• DNS Server
• DNS Manager
• Persistent Storage
• (Optional) In-memory DNS Tree inside the server
b. Relationships and interactions:
• Resolver → Server: “DNS_QUERY” over TCP/UDP
• Server → Resolver: “DNS_RESPONSE”
• Manager → Server: “ADD_RECORD” / “REMOVE_RECORD”
• Server ↔ Persistent Storage: read on startup, write on updates
c. Architectural patterns and principles:
• Client-Server model (single server instance)
• Separation of concerns: resolution vs. management vs. storage
• Single source of truth for DNS records in text files and in-memory tree
d. Key technologies and libraries:
• Python 3.x
• socket (network I/O)
• Custom tree data structure for DNS zones
• Plain-text flat files for persistence