[deprecated, developmeht moved to https://github.com/mirage/ocaml-dns] µDNS - an opinionated Domain Name System (DNS) library
(c) 2017-2019 Hannes Mehnert (robur.io, Center for the Cultivation of Technology)
%%VERSION%%
µDNS supports most of the domain name system used in the wild. It adheres to strict conventions. Failing early and hard. It is mostly implemented in the pure fragment of OCaml (no mutation, isolated IO, no exceptions).
It all started out as an experiment to run a recursive resolver, but after
initial prototypes it turned out that every configurable recursive resolver
needs a fully-fledged authoritative nameserver as well (for overriding various
zones such as .localhost
and reverse lookups of RFC 1918 IP ranges).
Legacy resource record types are not dealt with, and there is no plan to support
ISDN
, MAILA
, MAILB
, WKS
, MB
, NULL
, HINFO
, ... . AXFR
, IXFR
,
and UPDATE
is only handled via TCP connections. The only resource class
supported is IN
(the Internet). In a similar vein, wildcard records are not
supported, and it is unlikely they'll ever be in this library. Truncated hmac
in TSIG
are not supported (always the full length of the hash algorithm is
used).
Please read the blog article for a more detailed overview.
The µDNS library is published under the 2 clause BSD license.
*
RFC 5001 DNS Name Server Identifier (NSID) Option*
RFC 6762 Multicast DNS*
RFC 7828 The edns-tcp-keepalive EDNS0 Option*
RFC 7830 The EDNS(0) Padding Option*
RFC 7873 Domain Name System (DNS) Cookies*
: Please note that the RFCs marked with *
are only partially implemented
(i.e. only wire format, but no logic handling the feature).
You first need to install OCaml (at least 4.04.0) and
opam, the OCaml package manager (at least 2.0.0) on
your machine (you can use opam to install an up-to-date OCaml (opam switch 4.07.1
)).
You may want to follow the mirage installation
instructions to get mirage
installed on your
computer.
To lower the amount of run-time dependencies for each individual functionality, the library is split across a number of opam packages.
µDNS is not released yet, but you can install it and its dependencies via opam, see Development.
Now the µDNS library is installed, and you can try out the examples. Find some examples at the unikernel repository.
API documentation is available online.
To work with the opam packages provided when developing modifications to µDNS, or when pinning a specific version, you will have to pin the same version for all of them:
: csh syntax
set version=2.0.0
set repo=git+https://github.com/roburio/udns.git
# the -y parameter means "force" or
# "do go ahead and register a new package"
# the -n parameter means
# "just register the pin, don't actually install it yet"
foreach pkg ( dns dns-{certify,cli,client{,-lwt,-unix}} \
dns-mirage{,-certify,-client,-resolver,-server} \
dns-{resolver,server,tsig,zone} )
opam pin add -y -n $pkg.$version --dev $repo
end
: bash syntax
version=2.0.0
repo=git+https://github.com/roburio/udns.git
for pkg in dns dns-{certify,cli,client{,-lwt,-unix}} \
dns-mirage{,-certify,-client,-resolver,-server} \
dns-{resolver,server,tsig,zone}
do
opam pin add -y -n $pkg.$version --dev $repo
done
Now you can install the packages you need, for instance:
opam install dns-client-lwt
or
opam install dns-resolver