Skip to content

This repository contains the code for a DNS server implemented in Rust, as part of the tutorial Building a DNS Server in Rust

Notifications You must be signed in to change notification settings

Rust-Trends/dns-server-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DNS Server in Rust

This repository contains the code for a DNS server implemented in Rust, as part of the tutorial Building a DNS Server in Rust . The tutorial covers:

  • Understanding DNS requests and responses.
  • Handling UDP packets in Rust.
  • Parsing and constructing DNS packets.
  • Implementing decompression of DNS packets.
  • Forwarding DNS queries to resolvers.

πŸ“– Tutorial

For a step-by-step guide, check out the full tutorial: Building a DNS Server in Rust: Part 1 of 2

πŸ›  Installation

Ensure you have Rust installed:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Clone this repository:

git clone https://github.com/Rust-Trends/dns-server-tutorial.git
cd dns-server-tutorial

πŸš€ Running the Server

Goto to the step you want to explore, e.g. step1, and start the DNS server on port 1053:

cd step1
cargo run

πŸ” Testing with dig

To test your server, open another terminal and run:

dig @localhost -p 1053 www.rust-trends.com

🀝 Contributions

Feel free to open issues or submit pull requests to improve the project!

πŸ“œ License: MIT

About

This repository contains the code for a DNS server implemented in Rust, as part of the tutorial Building a DNS Server in Rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages