package dns-lwt

  1. Overview
  2. Docs


This is an implementation of the DNS protocol and a client and server resolver using the portable Lwt concurrency framework. You can find a Unix version of this library in the dns-lwt-unix opam package, and in theory you could compile this one to JavaScript as well using js_of_ocaml.


org:mirage org:xapi-project

Published: 11 Jan 2019


OCaml-DNS - DNS client and server implementation in pure OCaml

This is a pure OCaml implementation of the DNS protocol. It is intended to be a reasonably high-performance implementation, but clarity is preferred rather than low-level performance hacks.

To build it, please use the OPAM package manager (1.2+):

opam pin add dns .

This will install the dependencies needed and give you a working development version of the library.


  • lib/ contains the core DNS protocol, which is packed into the Dns module.

  • lib_test/ contains unit tests and sample uses of the library. In particular, time_server is a simple dynamic responder.

Areas that need work:

  • We need an Lwt-based client iterative resolver Patches for this are highly welcome!

  • EDNS0 extensions

  • DNSSEC extensions (using nocrypto)

  • TC bit and TCP fallback

  • mDNS resolver

Dependencies (5)

  1. dns = version
  2. lwt >= "3.0.0"
  3. mirage-profile >= "0.8.0"
  4. dune
  5. ocaml >= "4.03.0"

Dev Dependencies


Used by (3)

  1. dns-lwt-unix < "1.1.3"
  2. mirage-dns >= "3.0.0" & < "3.1.3"
  3. vpnkit >= "0.1.1"