| Crates.io | dns_in_a_weekend |
| lib.rs | dns_in_a_weekend |
| version | 0.1.1 |
| created_at | 2023-05-14 22:34:10.350547+00 |
| updated_at | 2023-05-14 22:35:58.515863+00 |
| description | A toy implementation of a DNS server that implements caching. |
| homepage | https://github.com/aalekhpatel07/rdns |
| repository | https://github.com/aalekhpatel07/rdns |
| max_upload_size | |
| id | 864511 |
| size | 84,234 |
This is a toy implementation of a DNS server that follows the Implement DNS in a weekend guide.
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.
cargocargo install dns-in-a-weekend
Checkout the project and run if you have cargo already set up.
cargo build --release
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).