caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jehan Pagès" <jehan.marmottard@gmail.com>
To: caml-list@inria.fr
Subject: [Caml-list] ODNS 0.2: DNS library for Objective Caml
Date: Fri, 4 Feb 2011 19:35:18 +0900	[thread overview]
Message-ID: <AANLkTin44-QcWt-hbqWPxKpaC4MuT67eZLGdjcEGB-e_@mail.gmail.com> (raw)

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

             reply	other threads:[~2011-02-04 10:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-04 10:35 Jehan Pagès [this message]
2011-02-04 10:54 ` David Allsopp
2011-02-04 11:31 ` rixed
2011-02-04 12:21   ` Gerd Stolpmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTin44-QcWt-hbqWPxKpaC4MuT67eZLGdjcEGB-e_@mail.gmail.com \
    --to=jehan.marmottard@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).