caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ODNS 0.2: DNS library for Objective Caml
@ 2011-02-04 10:35 Jehan Pagès
  2011-02-04 10:54 ` David Allsopp
  2011-02-04 11:31 ` rixed
  0 siblings, 2 replies; 4+ messages in thread
From: Jehan Pagès @ 2011-02-04 10:35 UTC (permalink / raw)
  To: caml-list

Hi all,

I just wanted to announce the first official release of ODNS (version
0.2), a GPLv2 library written in Objective Caml, entirely natively
(this is not a binding to a C library, or anything. Actually there is
no dependency at all in the library as only the Standard lib is used)
whose goal is to query DNS servers in programs.

It is detailed, documented and available for download here:
http://odns.tuxfamily.org/

Full API is here: http://odns.tuxfamily.org/doc/dns/html/

For history note: I could not find any of such library evolved enough
(that does not
mean there is not, I just did not find it), but I found some beginning
of such in an old 2002 email, and the previous authors accepted to
release me the piece of code in GPLv2, so I worked from this version
(which I labeled 0.1 but this original version should really not be
used) and I thank them as it was a good base.

It probably won't evolve much in features now as long as I don't need them
(I "may" need DNSSEC in some time in the future, so there is a
possibility I implement that when necessary, but not now. Also I
accept any good patch of course and I can discuss with and help people
who want to write these patches) but I will
keep it up to date for any possible bug fix as I developed this for
another bigger project where I needed in particular SRV record
support. This is just to say that this will remain maintained so you
can use it safely. And don't hesitate to drop any bug report.

The current features are pretty much the usual features of all
resolvers, with a use as easy as (for instance with SRV):

let q = Dns.query in
q#add_query ~qtype:"SRV" ~qname="_xmpp-client._tcp.xmpp.org";
q#action;
(* Do something with q#answers which are all the resource records in
answer section, q#authorities are records in Authority section and
q#additionals for Additional section! *)

Of course with a bunch of more powerful configuration methods if
defaults don't suit you (change the timeout, retry number, use
specific name servers instead of the one your system is set with,
etc.).

But especially I also added some extremely useful helper functions.
Indeed raw use of a
resolver is nice because this is generic (so you can just do any kind
of query), but there is usually a lot more processing to do after
(reordering answers, removing some, making new queries as a result of
the answers of a previous one, and so on. Semantic use of record's
fields in other words). For instance:

Dns_helper.srv_lookup ~query:"_xmpp-client._tcp.xmpp.org"
-> directly returns a list of IPs to be tried (already in the right
order) for the Jabber service of xmpp.org. All processing has already
been done (if you know SRV records, you know there are many stuffs to
do afterwards, and several queries to run as well, while all you want
in the end is a list of IPs).
So a lot of processing in a single function.

I hope some people out there like it! :-)
Bye.

Jehan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [Caml-list] ODNS 0.2: DNS library for Objective Caml
  2011-02-04 10:35 [Caml-list] ODNS 0.2: DNS library for Objective Caml Jehan Pagès
@ 2011-02-04 10:54 ` David Allsopp
  2011-02-04 11:31 ` rixed
  1 sibling, 0 replies; 4+ messages in thread
From: David Allsopp @ 2011-02-04 10:54 UTC (permalink / raw)
  To: 'caml-list@inria.fr'

Jehan Pagès wrote:
> I just wanted to announce the first official release of ODNS (version
> 0.2), a GPLv2 library written in Objective Caml, entirely natively (this
> is not a binding to a C library, or anything. Actually there is no
> dependency at all in the library as only the Standard lib is used) whose
> goal is to query DNS servers in programs.

This sounds very interesting - do you have a particular reason for using GPLv2 rather than LGPLv3+static linking exception (sometimes referred to as the "OCaml Linking Exception" as it's part of the OCaml licence for the standard libraries)?


David


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] ODNS 0.2: DNS library for Objective Caml
  2011-02-04 10:35 [Caml-list] ODNS 0.2: DNS library for Objective Caml Jehan Pagès
  2011-02-04 10:54 ` David Allsopp
@ 2011-02-04 11:31 ` rixed
  2011-02-04 12:21   ` Gerd Stolpmann
  1 sibling, 1 reply; 4+ messages in thread
From: rixed @ 2011-02-04 11:31 UTC (permalink / raw)
  To: caml-list

Is the resolution synchronous or not ?
From your exemple it looks like it is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] ODNS 0.2: DNS library for Objective Caml
  2011-02-04 11:31 ` rixed
@ 2011-02-04 12:21   ` Gerd Stolpmann
  0 siblings, 0 replies; 4+ messages in thread
From: Gerd Stolpmann @ 2011-02-04 12:21 UTC (permalink / raw)
  To: rixed; +Cc: caml-list

Am Freitag, den 04.02.2011, 12:31 +0100 schrieb rixed@happyleptic.org:
> Is the resolution synchronous or not ?
> From your exemple it looks like it is.

For asynchronous resolutions look at Netdns -
http://oss.wink.com/netdns/. It is not yet complete, but it can at least
be used as stub resolver, and for keeping a local cache of DNS results.

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann, Bad Nauheimer Str.3, 64289 Darmstadt,Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-04 12:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-04 10:35 [Caml-list] ODNS 0.2: DNS library for Objective Caml Jehan Pagès
2011-02-04 10:54 ` David Allsopp
2011-02-04 11:31 ` rixed
2011-02-04 12:21   ` Gerd Stolpmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).