dns_in_a_weekend

Crates.iodns_in_a_weekend
lib.rsdns_in_a_weekend
version0.1.1
sourcesrc
created_at2023-05-14 22:34:10.350547
updated_at2023-05-14 22:35:58.515863
descriptionA toy implementation of a DNS server that implements caching.
homepagehttps://github.com/aalekhpatel07/rdns
repositoryhttps://github.com/aalekhpatel07/rdns
max_upload_size
id864511
size84,234
Aalekh Patel (aalekhpatel07)

documentation

README

DNS Server In A Weekend

This is a toy implementation of a DNS server that follows the Implement DNS in a weekend guide.

Usage

Start the DNS server at port 5354:

RUST_LOG=info dns-in-a-weekend --port 5354

Make a DNS request with dig to test that it is accessible:

dig @127.0.0.1 -p 5354 google.com

If dig prints the DNS response, it means everything is working.

Development

Install

Via cargo

cargo install dns-in-a-weekend

Build

Checkout the project and run if you have cargo already set up.

cargo build --release

Features

Caching

It implements caching of DNS resolutions so that we don't overwhelm the root name servers.

Caveat: The cache has no TTL so it could go stale (even though the DNSRecords themselves have TTLs we don't implement it here).

Commit count: 30

cargo fmt