Up

module Dns_resolver_unix

: sig
#
type t = {
# client
: (module Dns.Protocol.CLIENT);
# servers
: (Ipaddr.t * int) list;
# search_domains
: string list;
}
#
type config = [
| `Resolv_conf of string
| `Static of (Ipaddr.t * int) list * string 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 [root:domain_name].

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 [root:domain_name]s.
#
val resolve : t -> ?dnssec:bool -> Dns.Packet.q_class -> Dns.Packet.q_type -> Dns.Name.domain_name -> Dns.Packet.t Lwt.t

Resolve a fully specified query, [root:q_class], [root:q_type] and [root: domain_name].

Returns the full a [root:dns] structure.
end