This repository contains a simple DNS resolver written in Rust. It listens on port 2053 (standard DNS port) and forwards queries to a recursive resolver.
- Rust (stable version recommended) - (
rustc
) - Cargo package manager - (
cargo
)
- Clone this repository:
git clone https://github.com/bitsexplained/dns.git
- Navigate to the repository directory:
cd dns
- Install dependencies:
cargo build
- The server listens on port 2053 by default for incoming DNS queries.
- The server performs recursive lookups to resolve the hostname.
- The code uses the
dns
crate for parsing and generating DNS packets. - The
utils
crate provides some utility functions used by the server. - The
buffer
crate provides a buffer abstraction for handling byte data.
- The server can be extended to support additional DNS record types.
- The server can be configured to use specific DNS servers for lookups.
- You can add logging and monitoring capabilities to the server.
This is a basic DNS server implementation and may not be suitable for production use. It is intended for educational purposes and learning about DNS server implementation in Rust.