-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | DNS library in Haskell -- -- A thread-safe DNS library for both clients and servers written in pure -- Haskell. @package dns @version 2.0.13 -- | Data types for DNS Query and Response. For more information, see -- http://www.ietf.org/rfc/rfc1035. module Network.DNS.Types -- | Type for domain. type Domain = ByteString -- | Raw data format for resource records. data ResourceRecord ResourceRecord :: Domain -> TYPE -> Int -> RData -> ResourceRecord [rrname] :: ResourceRecord -> Domain [rrtype] :: ResourceRecord -> TYPE [rrttl] :: ResourceRecord -> Int [rdata] :: ResourceRecord -> RData OptRecord :: Int -> Bool -> Int -> RData -> ResourceRecord [orudpsize] :: ResourceRecord -> Int [ordnssecok] :: ResourceRecord -> Bool [orversion] :: ResourceRecord -> Int [rdata] :: ResourceRecord -> RData -- | Raw data format for each type. data RData RD_NS :: Domain -> RData RD_CNAME :: Domain -> RData RD_DNAME :: Domain -> RData RD_MX :: Int -> Domain -> RData RD_PTR :: Domain -> RData RD_SOA :: Domain -> Domain -> Int -> Int -> Int -> Int -> Int -> RData RD_A :: IPv4 -> RData RD_AAAA :: IPv6 -> RData RD_TXT :: ByteString -> RData RD_SRV :: Int -> Int -> Int -> Domain -> RData RD_OPT :: [OData] -> RData RD_OTH :: ByteString -> RData RD_TLSA :: Word8 -> Word8 -> Word8 -> ByteString -> RData data OData OD_ClientSubnet :: Int -> Int -> IP -> OData OD_Unknown :: Int -> ByteString -> OData -- | Types for resource records. data TYPE A :: TYPE AAAA :: TYPE NS :: TYPE TXT :: TYPE MX :: TYPE CNAME :: TYPE SOA :: TYPE PTR :: TYPE SRV :: TYPE DNAME :: TYPE OPT :: TYPE DS :: TYPE RRSIG :: TYPE NSEC :: TYPE DNSKEY :: TYPE NSEC3 :: TYPE NSEC3PARAM :: TYPE TLSA :: TYPE CDS :: TYPE CDNSKEY :: TYPE CSYNC :: TYPE UNKNOWN :: Int -> TYPE intToType :: Int -> TYPE typeToInt :: TYPE -> Int data OPTTYPE ClientSubnet :: OPTTYPE OUNKNOWN :: Int -> OPTTYPE intToOptType :: Int -> OPTTYPE optTypeToInt :: OPTTYPE -> Int -- | An enumeration of all possible DNS errors that can occur. data DNSError -- | The sequence number of the answer doesn't match our query. This could -- indicate foul play. SequenceNumberMismatch :: DNSError -- | The number of retries for the request was exceeded. RetryLimitExceeded :: DNSError -- | The request simply timed out. TimeoutExpired :: DNSError -- | The answer has the correct sequence number, but returned an unexpected -- RDATA format. UnexpectedRDATA :: DNSError -- | The domain for query is illegal. IllegalDomain :: DNSError -- | The name server was unable to interpret the query. FormatError :: DNSError -- | The name server was unable to process this query due to a problem with -- the name server. ServerFailure :: DNSError -- | This code signifies that the domain name referenced in the query does -- not exist. NameError :: DNSError -- | The name server does not support the requested kind of query. NotImplemented :: DNSError -- | The name server refuses to perform the specified operation for policy -- reasons. For example, a name server may not wish to provide the -- information to the particular requester, or a name server may not wish -- to perform a particular operation (e.g., zone transfer) for particular -- data. OperationRefused :: DNSError -- | The server detected a malformed OPT RR. BadOptRecord :: DNSError -- | Raw data format for DNS Query and Response. data DNSMessage DNSMessage :: DNSHeader -> [Question] -> [ResourceRecord] -> [ResourceRecord] -> [ResourceRecord] -> DNSMessage [header] :: DNSMessage -> DNSHeader [question] :: DNSMessage -> [Question] [answer] :: DNSMessage -> [ResourceRecord] [authority] :: DNSMessage -> [ResourceRecord] [additional] :: DNSMessage -> [ResourceRecord] -- | For backward compatibility. type DNSFormat = DNSMessage -- | Raw data format for the header of DNS Query and Response. data DNSHeader DNSHeader :: Int -> DNSFlags -> DNSHeader [identifier] :: DNSHeader -> Int [flags] :: DNSHeader -> DNSFlags -- | Raw data format for the flags of DNS Query and Response. data DNSFlags DNSFlags :: QorR -> OPCODE -> Bool -> Bool -> Bool -> Bool -> RCODE -> Bool -> DNSFlags [qOrR] :: DNSFlags -> QorR [opcode] :: DNSFlags -> OPCODE [authAnswer] :: DNSFlags -> Bool [trunCation] :: DNSFlags -> Bool [recDesired] :: DNSFlags -> Bool [recAvailable] :: DNSFlags -> Bool [rcode] :: DNSFlags -> RCODE [authenData] :: DNSFlags -> Bool data QorR QR_Query :: QorR QR_Response :: QorR data OPCODE OP_STD :: OPCODE OP_INV :: OPCODE OP_SSR :: OPCODE data RCODE NoErr :: RCODE FormatErr :: RCODE ServFail :: RCODE NameErr :: RCODE NotImpl :: RCODE Refused :: RCODE BadOpt :: RCODE -- | Raw data format for DNS questions. data Question Question :: Domain -> TYPE -> Question [qname] :: Question -> Domain [qtype] :: Question -> TYPE responseA :: Int -> Question -> [IPv4] -> DNSMessage responseAAAA :: Int -> Question -> [IPv6] -> DNSMessage -- | Miscellaneous utility functions for processing DNS data. module Network.DNS.Utils -- | Perform both normalizeCase and normalizeRoot on the -- given Domain. When comparing DNS names taken from user input, -- this is often necessary to avoid unexpected results. -- -- Examples: -- --
--   >>> let domain1 = BS.pack "ExAmPlE.COM"
--   
--   >>> let domain2 = BS.pack "example.com."
--   
--   >>> domain1 == domain2
--   False
--   
--   >>> normalize domain1 == normalize domain2
--   True
--   
-- -- The normalize function should be idempotent: -- --
--   >>> normalize (normalize domain1) == normalize domain1
--   True
--   
-- -- Ensure that we don't crash on the empty Domain: -- --
--   >>> import qualified Data.ByteString.Char8 as BS ( empty )
--   
--   >>> normalize BS.empty
--   "."
--   
normalize :: Domain -> Domain -- | Normalize the case of the given DNS name for comparisons. -- -- According to RFC #1035, "For all parts of the DNS that are part of the -- official protocol, all comparisons between character strings (e.g., -- labels, domain names, etc.) are done in a case-insensitive manner." -- This function chooses to lowercase its argument, but that should be -- treated as an implementation detail if at all possible. -- -- Examples: -- --
--   >>> let domain1 = BS.pack "ExAmPlE.COM"
--   
--   >>> let domain2 = BS.pack "exAMPle.com"
--   
--   >>> domain1 == domain2
--   False
--   
--   >>> normalizeCase domain1 == normalizeCase domain2
--   True
--   
-- -- The normalizeCase function should be idempotent: -- --
--   >>> normalizeCase (normalizeCase domain2) == normalizeCase domain2
--   True
--   
-- -- Ensure that we don't crash on the empty Domain: -- --
--   >>> import qualified Data.ByteString.Char8 as BS ( empty )
--   
--   >>> normalizeCase BS.empty
--   ""
--   
normalizeCase :: Domain -> Domain -- | Normalize the given name by appending a trailing dot (the DNS root) if -- one does not already exist. -- -- Warning: this does not produce an equivalent DNS name! However, users -- are often unaware of the effect that the absence of the root will -- have. In user interface design, it may therefore be wise to act as if -- the user supplied the trailing dot during comparisons. -- -- Per RFC #1034, -- -- "Since a complete domain name ends with the root label, this leads to -- a printed form which ends in a dot. We use this property to -- distinguish between: -- -- -- -- Relative names are either taken relative to a well known origin, or to -- a list of domains used as a search list. Relative names appear mostly -- at the user interface, where their interpretation varies from -- implementation to implementation, and in master files, where they are -- relative to a single origin domain name." -- -- Examples: -- --
--   >>> let domain1 = BS.pack "example.com"
--   
--   >>> let domain2 = BS.pack "example.com."
--   
--   >>> domain1 == domain2
--   False
--   
--   >>> normalizeRoot domain1 == normalizeRoot domain2
--   True
--   
-- -- The normalizeRoot function should be idempotent: -- --
--   >>> normalizeRoot (normalizeRoot domain1) == normalizeRoot domain1
--   True
--   
-- -- Ensure that we don't crash on the empty Domain: -- --
--   >>> import qualified Data.ByteString.Char8 as BS ( empty )
--   
--   >>> normalizeRoot BS.empty
--   "."
--   
normalizeRoot :: Domain -> Domain module Network.DNS.Encode -- | Composing DNS data. encode :: DNSMessage -> ByteString encodeVC :: ByteString -> ByteString -- | Composing query. First argument is a number to identify response. composeQuery :: Int -> [Question] -> ByteString composeQueryAD :: Int -> [Question] -> ByteString module Network.DNS.Decode -- | Parsing DNS data. decode :: ByteString -> Either String DNSMessage -- | Parse many length-encoded DNS records, for example, from TCP traffic. decodeMany :: ByteString -> Either String ([DNSMessage], ByteString) -- | Receiving DNS data from Socket and parse it. receive :: Socket -> IO DNSMessage -- | Receive and parse a single virtual-circuit (TCP) response. It is up to -- the caller to implement any desired timeout. This (and the other -- response decoding functions) may throw ParseError when the server -- response is incomplete or malformed. receiveVC :: Socket -> IO DNSMessage instance GHC.Show.Show Network.DNS.Decode.RDATAParseError instance GHC.Exception.Exception Network.DNS.Decode.RDATAParseError -- | DNS Resolver and generic (lower-level) lookup functions. module Network.DNS.Resolver -- | Union type for FilePath and HostName. Specify -- FilePath to "resolv.conf" or numeric IP address in -- String form. -- -- Warning: Only numeric IP addresses are valid -- RCHostNames. -- -- Example (using Google's public DNS cache): -- --
--   >>> let cache = RCHostName "8.8.8.8"
--   
data FileOrNumericHost -- | A path for "resolv.conf" RCFilePath :: FilePath -> FileOrNumericHost -- | A numeric IP address RCHostName :: HostName -> FileOrNumericHost -- | A numeric IP address and port number RCHostPort :: HostName -> PortNumber -> FileOrNumericHost -- | Type for resolver configuration. The easiest way to construct a -- ResolvConf object is to modify the defaultResolvConf. data ResolvConf ResolvConf :: FileOrNumericHost -> Int -> Int -> Integer -> ResolvConf [resolvInfo] :: ResolvConf -> FileOrNumericHost -- | Timeout in micro seconds. [resolvTimeout] :: ResolvConf -> Int -- | The number of retries including the first try. [resolvRetry] :: ResolvConf -> Int -- | This field was obsoleted. [resolvBufsize] :: ResolvConf -> Integer -- | Return a default ResolvConf: -- -- -- -- Example (use Google's public DNS cache instead of resolv.conf): -- --
--   >>> let cache = RCHostName "8.8.8.8"
--   
--   >>> let rc = defaultResolvConf { resolvInfo = cache }
--   
defaultResolvConf :: ResolvConf -- | Abstract data type of DNS Resolver seed. When implementing a DNS -- cache, this should be re-used. data ResolvSeed -- | Make a ResolvSeed from a ResolvConf. -- -- Examples: -- --
--   >>> rs <- makeResolvSeed defaultResolvConf
--   
makeResolvSeed :: ResolvConf -> IO ResolvSeed -- | Abstract data type of DNS Resolver When implementing a DNS cache, this -- MUST NOT be re-used. data Resolver Resolver :: IO Int -> Socket -> Int -> Int -> Integer -> Resolver [genId] :: Resolver -> IO Int [dnsSock] :: Resolver -> Socket [dnsTimeout] :: Resolver -> Int [dnsRetry] :: Resolver -> Int [dnsBufsize] :: Resolver -> Integer -- | Giving a thread-safe Resolver to the function of the second -- argument. A socket for UDP is opened inside and is surely closed. -- Multiple withResolvers can be used concurrently. Multiple -- lookups must be done sequentially with a given Resolver. If -- multiple Resolvers are necessary for concurrent purpose, use -- withResolvers. withResolver :: ResolvSeed -> (Resolver -> IO a) -> IO a -- | Giving thread-safe Resolvers to the function of the second -- argument. Sockets for UDP are opened inside and are surely closed. For -- each Resolver, multiple lookups must be done sequentially. -- Resolvers can be used concurrently. withResolvers :: [ResolvSeed] -> ([Resolver] -> IO a) -> IO a -- | Look up resource records for a domain, collecting the results from the -- ANSWER section of the response. -- -- We repeat an example from Network.DNS.Lookup: -- --
--   >>> let hostname = Data.ByteString.Char8.pack "www.example.com"
--   
--   >>> rs <- makeResolvSeed defaultResolvConf
--   
--   >>> withResolver rs $ \resolver -> lookup resolver hostname A
--   Right [93.184.216.34]
--   
lookup :: Resolver -> Domain -> TYPE -> IO (Either DNSError [RData]) -- | Look up resource records for a domain, collecting the results from the -- AUTHORITY section of the response. lookupAuth :: Resolver -> Domain -> TYPE -> IO (Either DNSError [RData]) -- | Look up a name and return the entire DNS Response. If the initial UDP -- query elicits a truncated answer, the query is retried over TCP. The -- TCP retry may extend the total time taken by one more timeout beyond -- timeout * tries. -- -- Sample output is included below, however it is not tested the -- sequence number is unpredictable (it has to be!). -- -- The example code: -- --
--   let hostname = Data.ByteString.Char8.pack "www.example.com"
--   rs <- makeResolvSeed defaultResolvConf
--   withResolver rs $ resolver -> lookupRaw resolver hostname A
--   
--   
-- -- And the (formatted) expected output: -- --
--   Right (DNSMessage
--           { header = DNSHeader
--                        { identifier = 1,
--                          flags = DNSFlags
--                                    { qOrR = QR_Response,
--                                      opcode = OP_STD,
--                                      authAnswer = False,
--                                      trunCation = False,
--                                      recDesired = True,
--                                      recAvailable = True,
--                                      rcode = NoErr,
--                                      authenData = False
--                                    },
--                        },
--             question = [Question { qname = "www.example.com.",
--                                    qtype = A}],
--             answer = [ResourceRecord {rrname = "www.example.com.",
--                                       rrtype = A,
--                                       rrttl = 800,
--                                       rdlen = 4,
--                                       rdata = 93.184.216.119}],
--             authority = [],
--             additional = []})
--   
--   
lookupRaw :: Resolver -> Domain -> TYPE -> IO (Either DNSError DNSMessage) -- | Same as lookupRaw, but the query sets the AD bit, which solicits the -- the authentication status in the server reply. In most applications -- (other than diagnostic tools) that want authenticated data It is -- unwise to trust the AD bit in the responses of non-local servers, this -- interface should in most cases only be used with a loopback resolver. lookupRawAD :: Resolver -> Domain -> TYPE -> IO (Either DNSError DNSMessage) -- | Extract necessary information from DNSMessage fromDNSMessage :: DNSMessage -> (DNSMessage -> a) -> Either DNSError a -- | For backward compatibility. fromDNSFormat :: DNSMessage -> (DNSMessage -> a) -> Either DNSError a -- | Simple, high-level DNS lookup functions. -- -- All of the lookup functions necessary run in IO, since they interact -- with the network. The return types are similar, but differ in what can -- be returned from a successful lookup. -- -- We can think of the return type as "either what I asked for, or an -- error". For example, the lookupA function, if successful, will -- return a list of IPv4. The lookupMX function will -- instead return a list of (Domain,Int) pairs, where -- each pair represents a hostname and its associated priority. -- -- The order of multiple results may not be consistent between lookups. -- If you require consistent results, apply sort to the returned -- list. -- -- The errors that can occur are the same for all lookups. Namely: -- -- -- -- If an error occurs, you should be able to pattern match on the -- DNSError constructor to determine which of these is the case. -- -- Note: A result of "no records" is not considered an error. If -- you perform, say, an 'AAAA' lookup for a domain with no such records, -- the "success" result would be Right []. -- -- We perform a successful lookup of "www.example.com": -- --
--   >>> let hostname = Data.ByteString.Char8.pack "www.example.com"
--   
--   >>> 
--   
--   >>> rs <- makeResolvSeed defaultResolvConf
--   
--   >>> withResolver rs $ \resolver -> lookupA resolver hostname
--   Right [93.184.216.34]
--   
-- -- The only error that we can easily cause is a timeout. We do this by -- creating and utilizing a ResolvConf which has a timeout of one -- millisecond and a very limited number of retries: -- --
--   >>> let hostname = Data.ByteString.Char8.pack "www.example.com"
--   
--   >>> let badrc = defaultResolvConf { resolvTimeout = 1, resolvRetry = 1 }
--   
--   >>> 
--   
--   >>> rs <- makeResolvSeed badrc
--   
--   >>> withResolver rs $ \resolver -> lookupA resolver hostname
--   Left RetryLimitExceeded
--   
-- -- As is the convention, successful results will always be wrapped in a -- Right, while errors will be wrapped in a Left. -- -- For convenience, you may wish to enable GHC's OverloadedStrings -- extension. This will allow you to avoid calling pack on each -- domain name. See -- http://www.haskell.org/ghc/docs/7.6.3/html/users_guide/type-class-extensions.html#overloaded-strings -- for more information. module Network.DNS.Lookup -- | Look up all 'A' records for the given hostname. -- -- A straightforward example: -- --
--   >>> let hostname = Data.ByteString.Char8.pack "www.mew.org"
--   
--   >>> 
--   
--   >>> rs <- makeResolvSeed defaultResolvConf
--   
--   >>> withResolver rs $ \resolver -> lookupA resolver hostname
--   Right [210.130.207.72]
--   
-- -- This function will also follow a CNAME and resolve its target if one -- exists for the queries hostname: -- --
--   >>> let hostname = Data.ByteString.Char8.pack "www.kame.net"
--   
--   >>> 
--   
--   >>> rs <- makeResolvSeed defaultResolvConf
--   
--   >>> withResolver rs $ \resolver -> lookupA resolver hostname
--   Right [203.178.141.194]
--   
lookupA :: Resolver -> Domain -> IO (Either DNSError [IPv4]) -- | Look up all (IPv6) 'AAAA' records for the given hostname. -- -- Examples: -- --
--   >>> let hostname = Data.ByteString.Char8.pack "www.wide.ad.jp"
--   
--   >>> 
--   
--   >>> rs <- makeResolvSeed defaultResolvConf
--   
--   >>> withResolver rs $ \resolver -> lookupAAAA resolver hostname
--   Right [2001:200:dff:fff1:216:3eff:fe4b:651c]
--   
lookupAAAA :: Resolver -> Domain -> IO (Either DNSError [IPv6]) -- | Look up all 'MX' records for the given hostname. Two parts constitute -- an MX record: a hostname , and an integer priority. We therefore -- return each record as a (Domain, Int). -- -- In this first example, we look up the MX for the domain "example.com". -- It has no MX (to prevent a deluge of spam from examples posted on the -- internet). But remember, "no results" is still a successful result. -- --
--   >>> let hostname = Data.ByteString.Char8.pack "example.com"
--   
--   >>> 
--   
--   >>> rs <- makeResolvSeed defaultResolvConf
--   
--   >>> withResolver rs $ \resolver -> lookupMX resolver hostname
--   Right []
--   
-- -- The domain "mew.org" does however have a single MX: -- --
--   >>> let hostname = Data.ByteString.Char8.pack "mew.org"
--   
--   >>> 
--   
--   >>> rs <- makeResolvSeed defaultResolvConf
--   
--   >>> withResolver rs $ \resolver -> lookupMX resolver hostname
--   Right [("mail.mew.org.",10)]
--   
-- -- Also note that all hostnames are returned with a trailing dot to -- indicate the DNS root. lookupMX :: Resolver -> Domain -> IO (Either DNSError [(Domain, Int)]) -- | Look up all 'MX' records for the given hostname, and then resolve -- their hostnames to IPv4 addresses by calling lookupA. The -- priorities are not retained. -- -- Examples: -- --
--   >>> import Data.List (sort)
--   
--   >>> let hostname = Data.ByteString.Char8.pack "wide.ad.jp"
--   
--   >>> 
--   
--   >>> rs <- makeResolvSeed defaultResolvConf
--   
--   >>> ips <- withResolver rs $ \resolver -> lookupAviaMX resolver hostname
--   
--   >>> fmap sort ips
--   Right [133.138.10.39,203.178.136.30]
--   
-- -- Since there is more than one result, it is necessary to sort the list -- in order to check for equality. lookupAviaMX :: Resolver -> Domain -> IO (Either DNSError [IPv4]) -- | Look up all 'MX' records for the given hostname, and then resolve -- their hostnames to IPv6 addresses by calling lookupAAAA. The -- priorities are not retained. lookupAAAAviaMX :: Resolver -> Domain -> IO (Either DNSError [IPv6]) -- | Look up all 'NS' records for the given hostname. The results are taken -- from the ANSWER section of the response (as opposed to AUTHORITY). For -- details, see e.g. http://www.zytrax.com/books/dns/ch15/. -- -- There will typically be more than one name server for a domain. It is -- therefore extra important to sort the results if you prefer them to be -- at all deterministic. -- -- Examples: -- --
--   >>> import Data.List (sort)
--   
--   >>> let hostname = Data.ByteString.Char8.pack "mew.org"
--   
--   >>> 
--   
--   >>> rs <- makeResolvSeed defaultResolvConf
--   
--   >>> ns <- withResolver rs $ \resolver -> lookupNS resolver hostname
--   
--   >>> fmap sort ns
--   Right ["ns1.mew.org.","ns2.mew.org."]
--   
lookupNS :: Resolver -> Domain -> IO (Either DNSError [Domain]) -- | Look up all 'NS' records for the given hostname. The results are taken -- from the AUTHORITY section of the response and not the usual ANSWER -- (use lookupNS for that). For details, see e.g. -- http://www.zytrax.com/books/dns/ch15/. -- -- There will typically be more than one name server for a domain. It is -- therefore extra important to sort the results if you prefer them to be -- at all deterministic. -- -- For an example, we can look up the nameservers for "example.com" from -- one of the root servers, a.gtld-servers.net, the IP address of which -- was found beforehand: -- --
--   >>> import Data.List (sort)
--   
--   >>> let hostname = Data.ByteString.Char8.pack "example.com"
--   
--   >>> 
--   
--   >>> let ri = RCHostName "192.5.6.30" -- a.gtld-servers.net
--   
--   >>> let rc = defaultResolvConf { resolvInfo = ri }
--   
--   >>> rs <- makeResolvSeed rc
--   
--   >>> ns <- withResolver rs $ \resolver -> lookupNSAuth resolver hostname
--   
--   >>> fmap sort ns
--   Right ["a.iana-servers.net.","b.iana-servers.net."]
--   
lookupNSAuth :: Resolver -> Domain -> IO (Either DNSError [Domain]) -- | Look up all 'TXT' records for the given hostname. The results are -- free-form ByteStrings. -- -- Two common uses for 'TXT' records are -- http://en.wikipedia.org/wiki/Sender_Policy_Framework and -- http://en.wikipedia.org/wiki/DomainKeys_Identified_Mail. As an -- example, we find the SPF record for "mew.org": -- --
--   >>> let hostname = Data.ByteString.Char8.pack "mew.org"
--   
--   >>> 
--   
--   >>> rs <- makeResolvSeed defaultResolvConf
--   
--   >>> withResolver rs $ \resolver -> lookupTXT resolver hostname
--   Right ["v=spf1 +mx -all"]
--   
lookupTXT :: Resolver -> Domain -> IO (Either DNSError [ByteString]) -- | Look up all 'PTR' records for the given hostname. To perform a reverse -- lookup on an IP address, you must first reverse its octets and then -- append the suffix ".in-addr.arpa." -- -- We look up the PTR associated with the IP address 210.130.137.80, -- i.e., 80.137.130.210.in-addr.arpa: -- --
--   >>> let hostname = Data.ByteString.Char8.pack "164.2.232.202.in-addr.arpa"
--   
--   >>> 
--   
--   >>> rs <- makeResolvSeed defaultResolvConf
--   
--   >>> withResolver rs $ \resolver -> lookupPTR resolver hostname
--   Right ["www.iij.ad.jp."]
--   
-- -- The lookupRDNS function is more suited to this particular task. lookupPTR :: Resolver -> Domain -> IO (Either DNSError [Domain]) -- | Convenient wrapper around lookupPTR to perform a reverse lookup -- on a single IP address. -- -- We repeat the example from lookupPTR, except now we pass the IP -- address directly: -- --
--   >>> let hostname = Data.ByteString.Char8.pack "202.232.2.164"
--   
--   >>> 
--   
--   >>> rs <- makeResolvSeed defaultResolvConf
--   
--   >>> withResolver rs $ \resolver -> lookupRDNS resolver hostname
--   Right ["www.iij.ad.jp."]
--   
lookupRDNS :: Resolver -> Domain -> IO (Either DNSError [Domain]) -- | Look up all 'SRV' records for the given hostname. SRV records consist -- (see https://tools.ietf.org/html/rfc2782) of the following four -- fields: -- -- -- -- The first three are integral, and the target is another DNS hostname. -- We therefore return a four-tuple (Int,Int,Int,Domain). -- -- Examples: -- --
--   >>> let q = Data.ByteString.Char8.pack "_xmpp-server._tcp.jabber.ietf.org"
--   
--   >>> 
--   
--   >>> rs <- makeResolvSeed defaultResolvConf
--   
--   >>> withResolver rs $ \resolver -> lookupSRV resolver q
--   Right [(5,0,5269,"jabber.ietf.org.")]
--   
lookupSRV :: Resolver -> Domain -> IO (Either DNSError [(Int, Int, Int, Domain)]) -- | A thread-safe DNS library for both clients and servers written in pure -- Haskell. The Network.DNS module re-exports all other exposed modules -- for convenience. Applications will most likely use the high-level -- interface, while library/daemon authors may need to use the -- lower-level one. EDNS0 and TCP fallback are not supported yet. module Network.DNS