1
{- |
2
   Module      :  ADNS
3
   Copyright   :  (c) 2008 Peter Simons
4
   License     :  LGPL
5
6
   Maintainer  :  simons@cryp.to
7
   Stability   :  provisional
8
   Portability :  portable
9
10
   An asynchronous DNS resolver based on GNU ADNS
11
   <http://www.gnu.org/software/adns/>. You should link your
12
   program with the /threaded/ runtime-system when using this
13
   module. In GHC, this is accomplished by specifying @-threaded@
14
   on the command-line.
15
-}
16
17
module ADNS
18
  ( HostName, HostAddress
19
  , Resolver, initResolver, InitFlag(..)
20
  , queryA, queryPTR, queryMX, querySRV
21
  , dummyDNS
22
  )
23
  where
24
25
import Network           ( HostName, PortID )
26
import Network.Socket    ( HostAddress )
27
import ADNS.Base
28
import ADNS.Resolver
29
30
queryA :: Resolver -> HostName -> IO (Maybe [HostAddress])
31
queryA = query resolveA
32
33
-- | For quering SRV records. Result is the list of tuples (host, port).
34
querySRV :: Resolver -> HostName -> IO (Maybe [(HostName, PortID)])
35
querySRV = query resolveSRV
36
37
queryPTR :: Resolver -> HostAddress -> IO (Maybe [HostName])
38
queryPTR = query resolvePTR
39
40
queryMX :: Resolver -> HostName -> IO (Maybe [(HostName, HostAddress)])
41
queryMX = query resolveMX