A DNS resolver. This code acts like the resolver library from libc, except
that it can work asynchronously, and can return much more information.
At the moment, the interface is very much undecided but currently looks
like this:
import qualified Network.DNS.Client as DNS
DNS.resolve DNS.A "somedomain.com"
Right [(2008-02-01 00:27:14.861098 UTC, DNS.RRA [2466498203])]
The first element of the tuple is the time when the information expires.
The second depends on the record type requested (A, in this case) and
A records contain IP address, so that's a HostAddress in there.
This module parses etcresolv.conf for it's configuration. It needs a
recursive server to do the hard work. If you're lacking a recursive
server, you can setup dnscache (from djbdns) locally and point at that.
|