https://github.com/dominikrys/iris
🌐 DNS server
https://github.com/dominikrys/iris
dns rust server
Last synced: over 1 year ago
JSON representation
🌐 DNS server
- Host: GitHub
- URL: https://github.com/dominikrys/iris
- Owner: dominikrys
- License: mit
- Created: 2021-01-26T16:42:19.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-14T12:14:07.000Z (almost 5 years ago)
- Last Synced: 2025-01-20T21:55:19.837Z (over 1 year ago)
- Topics: dns, rust, server
- Language: Rust
- Homepage:
- Size: 146 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Iris
[](https://github.com/dominikrys/iris/actions)
Rudimentary DNS server implementation in Rust with support for the most common DNS record types. Written with the help of [Emil Hernvall's DNS guide](https://github.com/EmilHernvall/dnsguide). Non-exhaustive tests are also provided.
The aim of this project was to learn about Rust and DNS protocols.
## Demo
[](https://asciinema.org/a/422536)
## Build Instructions
[Rust](https://www.rust-lang.org/) (stable or nightly) needs to be installed. Then, run:
```bash
cargo build
```
For automated pre-commit/pre-push checks, a [Lefthook](https://github.com/evilmartians/lefthook) script is included. Run `lefthook install` to initialize it.
## How to Run
Run the server:
```bash
cargo run
```
Then, while the server is running, send a DNS query to port 2053:
```bash
dig @127.0.0.1 -p 2053 www.google.com
```
To run the provided tests:
```bash
cargo test
```
## Links
- [DNS packet structure reference](http://www.networksorcery.com/enp/protocol/dns.htm)
- [Domain name compression explanation](https://docstore.mik.ua/orelly/networking_2ndEd/dns/ch15_02.htm)
## Further Improvements
I've achieved what I wanted to with this project, but there are some further improvements that could be made:
- Support replies larger than 512B (TCP connection support is necessary for this)
- Concurrency
- Start resolving using other servers than the A root server
- Add support for hosting zones
- Allow acting as an authoritative server
- DNSSEC
- Add support for more records (SOA, TXT, SRV, OPT)