+ forever $ do
+ l <- getLine
+ case pdnsParse ver l of
+ Left e -> putStr $ pdnsReport e
+ Right preq -> do
+ case preq of
+ PdnsRequestQ qname qtype id _ _ _ ->
+ queryNmc mgr cfg id qname >>= putStr . (pdnsOut ver id qname qtype)
+ PdnsRequestAXFR xfrreq ->
+ putStr $ pdnsReport ("No support for AXFR " ++ xfrreq)
+ PdnsRequestPing -> putStrLn "END"
+
+-- query by key from Namecoin
+
+mainOne key = do
+ cfg <- readConfig confFile
+ mgr <- newManager def
+ dom <- queryNmc mgr cfg "+" key
+ putStrLn $ ppShow dom
+ putStr $ pdnsOut 1 "+" key RRTypeANY dom
+
+-- using file backend for testing json domain data