package dns-forward

  1. Overview
  2. Docs

A DNS resolver over TCP

type t
type message_cb = ?src:address -> ?dst:address -> buf:Cstruct.t -> unit -> unit Lwt.t

A callback called per message, which permits recording and analysis. If an address is unknown (e.g. it is selected by the kernel when routing the packets) then the corresponding argument will be omitted

val create : ?local_names_cb:(Dns.Packet.question -> Dns.Packet.rr list option Lwt.t) -> ?message_cb:message_cb -> Dns_forward.Config.t -> t Lwt.t

Construct a resolver given some configuration

val destroy : t -> unit Lwt.t

Destroy and free all resources associated with the resolver

Process a query by first checking whether the name can be satisfied locally via the local_names_cb and failing that, sending it to upstream servers according to the resolver configuration. The call will block forever if no server with a timeout is chosen; the client should be prepared to timeout and cancel the thread.

OCaml

Innovation. Community. Security.