]> www.average.org Git - pdns-pipe-nmc.git/blobdiff - pdns-pipe-nmc.hs
test function to interactively ask about a domain
[pdns-pipe-nmc.git] / pdns-pipe-nmc.hs
index 9e4a72930691ab6b58e53e6220c4d6c495c5e4ce..e9b29690aa0a866f2e57749dc41efa14fe304d4f 100644 (file)
@@ -100,3 +100,13 @@ main = do
           PdnsRequestAXFR xfrreq ->
             putStrLn ("ERROR\tNo support for AXFR " ++ xfrreq)
           PdnsRequestPing -> putStrLn "OK"
+
+-- for testing
+
+ask str = do
+  cfg <- readConfig confFile
+  mgr <- newManager def
+  ncres <- queryNmc mgr cfg str "test-req-id"
+  case ncres of
+    Left  e   -> putStrLn $ "ERROR\t" ++ e
+    Right dom -> putStrLn $ pdnsOut RRTypeANY dom