What's in a nameserver, Romeo?
This is a toy DNS server built in Rust. I did this to learn Rust and to understand DNS better. It's not intended for use in production environments.
🏊 Swim at your own risk!
- Dylan Nugent <@dylnuge>
Current functionality is mostly limited to protocol functionality and basic recursive resolution. The dns crate is capable of parsing and serializing DNS requests so long as they can fit in a single transmission packet (do not require truncation); TCP DNS is not currently supported. The server handles recursive resolution but does not do any DNSSEC checks and does not currently have any cache (each request to it will trigger a full set of authority lookups).
- Expand DNS protocol library functionality
- Support OPT (EDNS) records (RFC6891)
- Compress names using label pointers in responses
- Database (authoritative resolver) functionality
- Support reading authoritative records from DNS zone files
- Recursive resolver functionality
- Robust server functionality
- Support DNSSEC extensions
- Support DNS over HTTPS and/or DNS over TLS
There are a bunch of RFCs covering DNS. These are the ones I've been referencing the most (as well as their errata):
- RFC1035—The original implementation spec for DNS
- RFC1034—Defines core concepts of DNS
- RFC2535—DNSSEC extensions
- RFC3492—Punycode, the way DNS labels containing Unicode are encoded.
- RFC6891—EDNS0, which adds OPT records
I've also heavily referenced:
- IANA DNS Parameters—Used heavily in making all the enums; this has most of the DNS header field meanings as well as links to which specific RFC encodes them.