Portability | portable |
---|---|
Stability | provisional |
Maintainer | simons@cryp.to |
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 HostName = String
- type HostAddress = Word32
- 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)])
- querySRV :: Resolver -> HostName -> IO (Maybe [(HostName, PortID)])
- dummyDNS :: Resolver
Documentation
Either a host name e.g., "haskell.org"
or a numeric host
address string consisting of a dotted decimal IPv4 address or an
IPv6 address e.g., "192.168.0.1"
.
type HostAddress = Word32
NoEnv | do not look at environment |
NoErrPrint | never print output to stderr ( |
NoServerWarn | do not warn to stderr about duff nameservers etc |
Debug | enable all output to stderr plus |
LogPid | include process id in diagnostic output |
NoAutoSys | do not make syscalls at every opportunity |
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!) |
querySRV :: Resolver -> HostName -> IO (Maybe [(HostName, PortID)])Source
For quering SRV records. Result is the list of tuples (host, port).
Use this function to disable DNS resolving. It will
always return (
.
Answer
sSYSTEMFAIL
Nothing (Just
host) (-1) [])