I use nix, specifically nix-shell, simply run:
nix-shell --max-jobs auto
A new shell will (after a long build time the first time, sorry) open with all necessary dependencies to build and run the server.
To run (within nix-shell):
dune exec dns --release
To install nix follow: nix install dosc
If you would rather use dune directly instead of nix then you need to install the dependencies manually. Try dune build
and install the libraries that give errors.
A good and detailed overview is rfc standard. The standard can be hard to follow at times but the actual packet layout is well explained.
The resolver itself can handle the following query types:
type t =
| UNKOWN of int
| A
| NS
| CNAME
| MX
| AAAA
[@@deriving show { with_path = false }]
So IPv4 and IPv6 is supported.
Once server is built and running, simply open a new terminal and run:
dig @127.0.0.1 -p 2053 google.com
Of course, you can query for any website you'd like, google.com is just an example.