Lightweight and modular DNS server implementation in Rust, designed to handle basic DNS queries, encode and decode messages, and support customisable functionality. It supports functionalities such as parsing headers, questions, and resource records.
-
DNS Message Parsing:
- Decodes and encodes DNS messages according to the DNS protocol specification.
- Handles headers, questions, and resource records.
-
Big-Endian Encoding and Decoding:
- Converts integers (e.g.,
u16,u32) to and from big-endian byte arrays. - Encodes IP addresses and domain names into byte streams.
- Converts integers (e.g.,
- Rust (minimum version: 1.70)
Install Rust using rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shClone the repository:
git clone https://github.com/yourusername/dns-server.git
cd dns-serverBuild the project:
cargo buildRun the server:
./run_server --resolver <ip:port>Feel free to explore, modify, and use this DNS server as a learning resource or a building block for more advanced projects!