From 1452d1f1a3ac5b0387331ee7cabab4b5df96b2d1 Mon Sep 17 00:00:00 2001 From: joe Date: Tue, 11 Mar 2014 04:22:11 -0400 Subject: added nalias and nalias2 utilities --- nalias2.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 nalias2.hs (limited to 'nalias2.hs') diff --git a/nalias2.hs b/nalias2.hs new file mode 100644 index 00000000..609f2ec6 --- /dev/null +++ b/nalias2.hs @@ -0,0 +1,18 @@ +import System.Environment +import Control.Monad +import qualified Data.Text as Text + +import DNSCache + +main = do + dns <- newDNSCache + args <- getArgs + forM args $ \arg -> do + putStrLn $ arg ++ ":" + let targ = Text.pack arg + addrs <- forwardResolve dns targ + putStrLn $ " forward: " ++ show addrs + forM addrs $ \addr -> do + names <- reverseResolve dns addr + putStrLn $ " reverse "++show addr++": "++show names + return () -- cgit v1.2.3