diff options
author | joe <joe@jerkface.net> | 2014-03-11 04:22:11 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2014-03-11 04:22:11 -0400 |
commit | 1452d1f1a3ac5b0387331ee7cabab4b5df96b2d1 (patch) | |
tree | a81359dc7562b735f233f0966e07a0a0d57e928a /nalias2.hs | |
parent | c2807f80a5376cdb084503c0d80bc1eb24595b99 (diff) |
added nalias and nalias2 utilities
Diffstat (limited to 'nalias2.hs')
-rw-r--r-- | nalias2.hs | 18 |
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 @@ | |||
1 | import System.Environment | ||
2 | import Control.Monad | ||
3 | import qualified Data.Text as Text | ||
4 | |||
5 | import DNSCache | ||
6 | |||
7 | main = 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 () | ||