package dns

  1. Overview
  2. Docs
type t = {
  1. client : (module Dns.Protocol.CLIENT);
  2. servers : (Ipaddr.t * int) list;
  3. search_domains : string list;
}
type config = [
  1. | `Resolv_conf of string
    (*

    A resolv.conf filename

    *)
  2. | `Static of (Ipaddr.t * int) list * string list
    (*

    A list of hostname,port of stub resolvers, and a search domain list

    *)
]

Defines the location of the stub resolvers to use for client resolution.

val create : ?client:(module Dns.Protocol.CLIENT) -> ?config:config -> unit -> t Lwt.t

Create a resolver instance that either uses the system /etc/resolv.conf, or a statically specified preference

val gethostbyname : t -> ?q_class:Dns.Packet.q_class -> ?q_type:Dns.Packet.q_type -> string -> Ipaddr.t list Lwt.t

Lookup a Name.t.

  • returns

    the corresponding IPv4/6 addresses.

val gethostbyaddr : t -> ?q_class:Dns.Packet.q_class -> ?q_type:Dns.Packet.q_type -> Ipaddr.V4.t -> string list Lwt.t

Reverse lookup an IPv4 address.

  • returns

    the corresponding Name.ts.

val resolve : t -> ?dnssec:bool -> Dns.Packet.q_class -> Dns.Packet.q_type -> Dns.Name.t -> Dns.Packet.t Lwt.t

Resolve a fully specified query, q_class, q_type and Name.t.

  • returns

    the full a Dns structure.

OCaml

Innovation. Community. Security.