]> gitweb.michael.orlitzky.com - hath.git/blobdiff - src/DNS.hs
Remove the "reversed" mode -- do one thing and do it well and all that.
[hath.git] / src / DNS.hs
diff --git a/src/DNS.hs b/src/DNS.hs
deleted file mode 100644 (file)
index a535de5..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
--- | Helpers to perform DNS queries.
-module DNS (
-  Domain,
-  PTRResult,
-  lookup_ptrs )
-where
-
-import Control.Concurrent.ParallelIO.Global ( parallel )
-import Network.DNS (
-  Domain,
-  DNSError,
-  ResolvConf(..),
-  defaultResolvConf,
-  lookupRDNS,
-  makeResolvSeed,
-  withResolver )
-
-
--- The return type of lookupRDNS.
-type PTRResult = Either DNSError [Domain]
-
-
--- | Take the default ResolvConf and increase the timeout to 15
---   seconds.
-our_resolv_conf :: ResolvConf
-our_resolv_conf =
-  defaultResolvConf { resolvTimeout = 15*1000*1000 } -- 15s
-
-
--- | Takes a list of IP addresses (as ByteStrings) and performs
---   reverse (PTR) lookups on each of them.
-lookup_ptrs :: [Domain] -> IO [PTRResult]
-lookup_ptrs ips = do
-  rs <- makeResolvSeed our_resolv_conf
-  let lookup' addr = withResolver rs $ \resolver ->
-                       lookupRDNS resolver addr
-
-  parallel $ map lookup' ips