simple examples using ocaml-dns
This is the demo code for a step-by-step guide to setting up your own DNS resolver using MirageOS on Xen/ARM (though the code should work for Xen/x86 and Unix backends too). The tutorial is online:
- 1.1: setting up Xen ARM
- 1.2: how use gethostbyname in ocaml-dns to get the IP corresponding to a hardcoded IP. (code in gethostbyname/)
- 1.3: adding use of bootvars to part 1.2 (code in gethostbyname_bootvars/)
- 1.4: how to use resolve in ocaml-dns to get the IP corresponding to a hardcoded IP like a simple version of dig (code in basic_dig/)
- 2.1: a simple DNS server, which responses to requests for zones in the zone file (code in simple_server/)
- 3.1: a simple DNS forwarding resolve, given a DNS query resolve recusively by asking another DNS server (code in forwarder/)
- 3.2: combined DNS server, if zone is in zone file when use simple dns server (2.1), otherwise ask another DNS server (3.1) (code in forwarder_server/)
Part 4 - work in progress