This project is a custom DNS client–server system built in C# (.NET) using UDP sockets.
This assignment was made for my Networking class, which focuses on implementing a simplified DNS protocol using raw socket communication.
The application consists of two console programs:
- Client → Sends DNS lookup requests
- Server → Receives, processes, and responds to those lookups
The client and server communicate via UDP using Socket.SendTo() and Socket.ReceiveFrom().
Each message is formatted as a JSON object that includes a message ID, type, and content.
The communication flow:
- Handshake – The client sends a “Hello” message and receives a “Welcome” from the server.
- DNS Lookup – The client sends lookup requests containing a record type and domain name.
- Reply / Error – The server checks the data source (a JSON-based DNS list) and sends either:
- A valid record (
DNSLookupReply) - Or an error message (
Error)
- A valid record (
- Acknowledgment – The client confirms each reply with an
Ackmessage. - End – Once all requests are complete, the server sends an
Endmessage to close communication.
The server stays active after completion, waiting for the next client.