hsdns-1.3: Asynchronous DNS ResolverSource codeContentsIndex
An asynchronous DNS resolver based on GNU ADNS http://www.gnu.org/software/adns/. You should link your program with the threaded runtime-system when using this module. In GHC, this is accomplished by specifying -threaded on the command-line.
type Resolver = String -> RRType -> [QueryFlag] -> IO (MVar Answer)
initResolver :: [InitFlag] -> (Resolver -> IO a) -> IO a
data InitFlag
= NoEnv
| NoErrPrint
| NoServerWarn
| Debug
| LogPid
| NoAutoSys
| Eintr
| NoSigPipe
| CheckC_EntEx
| CheckC_Freq
queryA :: Resolver -> HostName -> IO (Maybe [HostAddress])
queryPTR :: Resolver -> HostAddress -> IO (Maybe [HostName])
queryMX :: Resolver -> HostName -> IO (Maybe [(HostName, HostAddress)])
dummyDNS :: Resolver
type Resolver = String -> RRType -> [QueryFlag] -> IO (MVar Answer)Source
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.
initResolver :: [InitFlag] -> (Resolver -> IO a) -> IO aSource
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.
data InitFlag Source
NoEnvdo not look at environment
NoErrPrintnever print output to stderr (Debug overrides)
NoServerWarndo not warn to stderr about duff nameservers etc
Debugenable all output to stderr plus Debug msgs
LogPidinclude process id in diagnostic output
NoAutoSysdo not make syscalls at every opportunity
Eintrallow adnsSynch to return eINTR
NoSigPipeapplication has SIGPIPE set to SIG_IGN, do not protect
CheckC_EntExdo consistency checks on entry/exit to adns functions
CheckC_Freqdo consistency checks very frequently (slow!)
show/hide Instances
queryA :: Resolver -> HostName -> IO (Maybe [HostAddress])Source
queryPTR :: Resolver -> HostAddress -> IO (Maybe [HostName])Source
queryMX :: Resolver -> HostName -> IO (Maybe [(HostName, HostAddress)])Source
dummyDNS :: ResolverSource
Use this function to disable DNS resolving. It will always return (Answer sSYSTEMFAIL Nothing (Just host) (-1) []).
Produced by Haddock version 2.3.0