|
Network.DNS | Portability | Haskell 2-pre | Stability | provisional | Maintainer | simons@cryp.to |
|
|
|
Description |
An asynchronous DNS resolver. Link your program with the
threaded runtime-system when you use this module. In
GHC, this is accomplished by specifying -threaded on
the command-line.
|
|
Synopsis |
|
|
|
Documentation |
|
|
A Resolver is an IO computation which -- given the
name and type of the record to query -- returns an MVar
that will eventually contain the Answer from the Domain
Name System.
|
|
|
Run the given IO computation with an Initialized
Resolver. Note that resolver functions can be shared,
and should be shared between any number of IO
threads. You may use multiple resolvers, of course, but
doing so defeats the purpose of an asynchronous resolver.
|
|
|
Resolve a hostname's A records.
|
|
|
Get the PTR records assigned to a host address. Note
that although the API allows for a record to have more
than one PTR entry, this will actually not happen
because the GNU adns library can't handle this case and
will return sINCONSISTENT.
|
|
|
Resolve the mail exchangers for a hostname. The returned
list may contain more than one entry per hostname, in
case the host has several A records. The records are
returned in the order you should try to contact them as
determined by the priority in the RRMX response.
|
|
|
Convenience wrapper that will modify any of the
revolveXXX functions above to return Maybe rather
than Either. The idea is that Nothing signifies any
sort of failure; Just [] signifies sNXDOMAIN; and
everything else signifies sOK.
So if you aren't interested in getting accurate Status
codes in case of failures. Wrap your DNS queries as
follows:
queryA :: Resolver -> HostName -> IO (Maybe [HostAddress])
queryA = query resolveA
|
|
HostName |
|
HostAddress |
|
|
Constructors | NoEnv | do not look at environment
| NoErrPrint | never print output to stderr (Debug overrides)
| NoServerWarn | do not warn to stderr about duff nameservers etc
| Debug | enable all output to stderr plus Debug msgs
| LogPid | include process id in diagnostic output
| NoAutoSys | do not make syscalls at every opportunity
| Eintr | allow adnsSynch to return eINTR
| NoSigPipe | application has SIGPIPE set to SIG_IGN, do not protect
| CheckC_EntEx | do consistency checks on entry/exit to adns functions
| CheckC_Freq | do consistency checks very frequently (slow!)
|
| Instances | |
|
|
|
Constructors | Search | use the searchlist
| UseVC | use a virtual circuit (TCP connection)
| Owner | fill in the owner field in the answer
| QuoteOk_Query | allow special chars in query domain
| QuoteOk_CName | allow special chars in CNAME we go via (default)
| QuoteOk_AnsHost | allow special chars in things supposed to be hostnames
| QuoteFail_CName | refuse if quote-req chars in CNAME we go via
| CName_Loose | allow refs to CNAMEs - without, get _s_cname
| CName_Forbid | don't follow CNAMEs, instead give _s_cname
|
| Instances | |
|
|
|
The record types we support.
| Constructors | | Instances | |
|
|
|
The status codes recognized by ADNS vary in different
versions of the library. So instead of providing an
Enum, the Status type contains the numeric value as
returned by ADNS itself. For common status codes, helper
functions like sOK or sNXDOMAIN are provided. The
functions adnsErrTypeAbbrev, adnsErrAbbrev, and
adnsStrerror can also be used to map these codes into
human readable strings.
| Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Original definition:
typedef struct {
char *host;
adns_status astatus;
int naddrs; /* temp fail => -1, perm fail => 0, s_ok => >0
adns_rr_addr *addrs;
} adns_rr_hostaddr;
The naddrs field is not available in RRHostAddr
because I couldn't see how that information wouldn't be
available in the astatus field too. If I missed
anything, please let me know.
Note: The data type should probably contain
HostAddress rather than RRAddr. I'm using the former
only because it has nicer output with show. poke is
not defined.
| Constructors | | Instances | |
|
|
|
Original definition:
typedef struct {
int i;
adns_rr_hostaddr ha;
} adns_rr_inthostaddr;
| Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Original definition:
typedef struct {
int len;
union {
struct sockaddr sa;
struct sockaddr_in inet;
} addr;
} adns_rr_addr;
Note: Anything but sockaddr_in will cause peek to call fail,
when marshaling this structure. poke is not defined.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map a Status code to a human-readable error
description. For example:
*ADNS> adnsStrerror sNXDOMAIN >>= print
"No such domain"
Use this function with great care: It will crash the
process when called with a status code that ADNS doesn't
know about. So use it only to print values you got from
the resolver!
|
|
|
Map a Status code to a short error name. Don't use
this function to print a status code unless you've
obtained it from the resolver!
|
|
|
Map a Status code to a short description of the type
of error. Don't use this function to print a status code
unless you've obtained it from the resolver!
|
|
|
Use this function to disable DNS resolving. It will
always return (Answer sSYSTEMFAIL Nothing (Just
host) (-1) []).
|
|
Produced by Haddock version 2.4.2 |