/dns-resolver

My toy DNS resolver.

Primary LanguageRust

DNS resolver

Check and Lint Test with Code Coverage codecov

A toy DNS resolver. It translates domain names to IP addresses.

Usage

Just pass a domain name as an argument.

cargo run <DOMAIN_NAME>
# or
./dns-resolver <DOMAIN_NAME>

Example:

./dns-resolver example.com
IP address: 93.184.215.14

Features

  • Recoursive resolve domain names starting from the root nameserver.
cargo run twitter.com
Querying 198.41.0.4 for twitter.com
Querying 192.41.162.30 for twitter.com
Querying 198.41.0.4 for a.r06.twtrdns.net
Querying 192.55.83.30 for a.r06.twtrdns.net
Querying 205.251.195.207 for a.r06.twtrdns.net
Querying 205.251.192.179 for twitter.com
IP address: 104.244.42.129

Rationale

I wanted to learn DNS and prefer to learn theory with practice. The How DNS works zine and the Implement DNS in a weekend guide by Julia Evans allowed me to understand and play with the technology.

Materials

Literature I used to learn about DNS: