A tiny recursive DNS server in Rust, following dnsguide.
It listens on UDP 0.0.0.0:2053, parses incoming DNS queries, and resolves
each one iteratively starting from a root nameserver
(a.root-servers.net / 198.41.0.4) — following NS referrals and glue
records, recursively resolving NS hostnames when no glue is provided.
cargo runThen, from another terminal:
dig @127.0.0.1 -p 2053 www.google.comcargo testCapture a query:
nc -u -l 1053 > query_packet.txt &
dig +retry=0 -p 1053 @127.0.0.1 +noedns google.comGet the matching response:
nc -u -w1 8.8.8.8 53 < query_packet.txt > response_packet.txt