summaryrefslogtreecommitdiff
path: root/nalias2.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-03-11 04:22:11 -0400
committerjoe <joe@jerkface.net>2014-03-11 04:22:11 -0400
commit1452d1f1a3ac5b0387331ee7cabab4b5df96b2d1 (patch)
treea81359dc7562b735f233f0966e07a0a0d57e928a /nalias2.hs
parentc2807f80a5376cdb084503c0d80bc1eb24595b99 (diff)
added nalias and nalias2 utilities
Diffstat (limited to 'nalias2.hs')
-rw-r--r--nalias2.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/nalias2.hs b/nalias2.hs
new file mode 100644
index 00000000..609f2ec6
--- /dev/null
+++ b/nalias2.hs
@@ -0,0 +1,18 @@
1import System.Environment
2import Control.Monad
3import qualified Data.Text as Text
4
5import DNSCache
6
7main = do
8 dns <- newDNSCache
9 args <- getArgs
10 forM args $ \arg -> do
11 putStrLn $ arg ++ ":"
12 let targ = Text.pack arg
13 addrs <- forwardResolve dns targ
14 putStrLn $ " forward: " ++ show addrs
15 forM addrs $ \addr -> do
16 names <- reverseResolve dns addr
17 putStrLn $ " reverse "++show addr++": "++show names
18 return ()