diff --git a/concurrent-dns-cache.cabal b/concurrent-dns-cache.cabal
--- a/concurrent-dns-cache.cabal
+++ b/concurrent-dns-cache.cabal
@@ -1,5 +1,5 @@
 Name:                   concurrent-dns-cache
-Version:                0.1.0
+Version:                0.1.1
 Author:                 Kazu Yamamoto <kazu@iij.ad.jp>
 Maintainer:             Kazu Yamamoto <kazu@iij.ad.jp>
 License:                BSD3
@@ -24,7 +24,7 @@
                       , async
                       , bytestring >= 0.10.4.0
                       , containers
-                      , dns
+                      , dns < 3
                       , iproute
                       , lifted-base
                       , monad-control
@@ -38,12 +38,14 @@
   Main-Is:              main.hs
   Default-Language:     Haskell2010
   GHC-Options:          -Wall -threaded
+  Hs-Source-Dirs:       test
   Build-Depends:        base >= 4 && < 5
                       , array
                       , async
                       , bytestring >= 0.10.4.0
+                      , concurrent-dns-cache
                       , containers
-                      , dns
+                      , dns < 3
                       , iproute
                       , lifted-base
                       , monad-control
@@ -62,7 +64,7 @@
   Build-Depends:        base >= 4 && < 5
                       , async
                       , concurrent-dns-cache
-                      , dns
+                      , dns < 3
                       , hspec
 
 Source-Repository head
diff --git a/main.hs b/main.hs
deleted file mode 100644
--- a/main.hs
+++ /dev/null
@@ -1,53 +0,0 @@
-{-# LANGUAGE OverloadedStrings #-}
-
-module Main where
-
-import Control.Concurrent (forkIO)
-import Control.Exception (try, SomeException(..))
-import Control.Monad (void, when)
-import qualified Data.ByteString.Char8 as BS
-import Network.DNS
-import Network.DNS.Cache as DNSC
-import Data.Time
-
-confs ::  [ResolvConf]
-confs = [
-    defaultResolvConf { resolvInfo = RCHostName "8.8.8.8" }
-  , defaultResolvConf { resolvInfo = RCHostName "8.8.4.4" }
-  ]
-
-maxCon :: Int
-maxCon = 50
-
-cacheConf :: DNSCacheConf
-cacheConf = DNSCacheConf {
-    resolvConfs    = confs
-  , maxConcurrency = maxCon
-  , minTTL         = 60
-  , maxTTL         = 300
-  , negativeTTL    = 300
-  }
-
-main :: IO ()
-main = do
-    beg <- getCurrentTime
-    withDNSCache cacheConf (loop 1 beg)
- where
-   loop :: Int -> UTCTime -> DNSCache -> IO ()
-   loop n beg cache = do
-       when (n `mod` 1000 == 0) $ do
-           cur <- getCurrentTime
-           putStrLn $ show n ++ ": " ++ show (cur `diffUTCTime` beg)
-       edom <- try BS.getLine
-       case edom of
-           Left (SomeException _) -> do
-               wait cache (== 0)
-               putStrLn "Done."
-           Right dom -> do
-               wait cache (< maxCon)
-               void $ forkIO (DNSC.resolve cache dom >>= p dom)
-               loop (n+1) beg cache
-   p _   (Right _) = return ()
-   p dom (Left  e) = do
-       putStr $ show e ++ " "
-       BS.putStrLn dom
diff --git a/test/main.hs b/test/main.hs
new file mode 100644
--- /dev/null
+++ b/test/main.hs
@@ -0,0 +1,53 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module Main where
+
+import Control.Concurrent (forkIO)
+import Control.Exception (try, SomeException(..))
+import Control.Monad (void, when)
+import qualified Data.ByteString.Char8 as BS
+import Network.DNS
+import Network.DNS.Cache as DNSC
+import Data.Time
+
+confs ::  [ResolvConf]
+confs = [
+    defaultResolvConf { resolvInfo = RCHostName "8.8.8.8" }
+  , defaultResolvConf { resolvInfo = RCHostName "8.8.4.4" }
+  ]
+
+maxCon :: Int
+maxCon = 50
+
+cacheConf :: DNSCacheConf
+cacheConf = DNSCacheConf {
+    resolvConfs    = confs
+  , maxConcurrency = maxCon
+  , minTTL         = 60
+  , maxTTL         = 300
+  , negativeTTL    = 300
+  }
+
+main :: IO ()
+main = do
+    beg <- getCurrentTime
+    withDNSCache cacheConf (loop 1 beg)
+ where
+   loop :: Int -> UTCTime -> DNSCache -> IO ()
+   loop n beg cache = do
+       when (n `mod` 1000 == 0) $ do
+           cur <- getCurrentTime
+           putStrLn $ show n ++ ": " ++ show (cur `diffUTCTime` beg)
+       edom <- try BS.getLine
+       case edom of
+           Left (SomeException _) -> do
+               wait cache (== 0)
+               putStrLn "Done."
+           Right dom -> do
+               wait cache (< maxCon)
+               void $ forkIO (DNSC.resolve cache dom >>= p dom)
+               loop (n+1) beg cache
+   p _   (Right _) = return ()
+   p dom (Left  e) = do
+       putStr $ show e ++ " "
+       BS.putStrLn dom
