diff --git a/tests/integrated/network-monitor.cpp b/tests/integrated/network-monitor.cpp
index 498b970..917dcae 100644
--- a/tests/integrated/network-monitor.cpp
+++ b/tests/integrated/network-monitor.cpp
@@ -23,13 +23,13 @@
 #define BOOST_TEST_DYN_LINK 1
 #define BOOST_TEST_MODULE ndn-cxx Integrated Tests (Network Monitor)
 
-#include "util/network-monitor.hpp"
+#include "net/network-monitor.hpp"
 
-#include "util/network-address.hpp"
-#include "util/network-interface.hpp"
+#include "net/network-address.hpp"
+#include "net/network-interface.hpp"
 #include "util/time.hpp"
 
-#include "util/detail/link-type-helper.hpp"
+#include "net/detail/link-type-helper.hpp"
 
 #include "boost-test.hpp"
 
@@ -37,10 +37,9 @@
 #include <iostream>
 
 namespace ndn {
-namespace util {
+namespace net {
 namespace tests {
 
-BOOST_AUTO_TEST_SUITE(Util)
 BOOST_AUTO_TEST_SUITE(TestNetworkMonitor)
 
 static std::ostream&
@@ -100,8 +99,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestNetworkMonitor
-BOOST_AUTO_TEST_SUITE_END() // Util
 
 } // namespace tests
-} // namespace util
+} // namespace net
 } // namespace ndn
diff --git a/tests/unit-tests/net/dns.t.cpp b/tests/unit-tests/net/dns.t.cpp
new file mode 100644
index 0000000..0e1aada
--- /dev/null
+++ b/tests/unit-tests/net/dns.t.cpp
@@ -0,0 +1,185 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2017 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "net/dns.hpp"
+
+#include "boost-test.hpp"
+#include "network-configuration-detector.hpp"
+
+#include <boost/asio/io_service.hpp>
+
+namespace ndn {
+namespace dns {
+namespace tests {
+
+using boost::asio::ip::address_v4;
+using boost::asio::ip::address_v6;
+
+class DnsFixture
+{
+public:
+  DnsFixture()
+    : m_nFailures(0)
+    , m_nSuccesses(0)
+  {
+  }
+
+  void
+  onSuccess(const IpAddress& resolvedAddress,
+            const IpAddress& expectedAddress,
+            bool isValid,
+            bool shouldCheckAddress = false)
+  {
+    ++m_nSuccesses;
+
+    if (!isValid) {
+      BOOST_FAIL("Resolved to " + resolvedAddress.to_string() + ", but should have failed");
+    }
+
+    BOOST_CHECK_EQUAL(resolvedAddress.is_v4(), expectedAddress.is_v4());
+
+    // checking address is not deterministic and should be enabled only
+    // if only one IP address will be returned by resolution
+    if (shouldCheckAddress) {
+      BOOST_CHECK_EQUAL(resolvedAddress, expectedAddress);
+    }
+  }
+
+  void
+  onFailure(bool isValid)
+  {
+    ++m_nFailures;
+
+    if (!isValid) {
+      BOOST_FAIL("Resolution should not have failed");
+    }
+
+    BOOST_CHECK_MESSAGE(true, "Resolution failed as expected");
+  }
+
+protected:
+  uint32_t m_nFailures;
+  uint32_t m_nSuccesses;
+  boost::asio::io_service m_ioService;
+};
+
+BOOST_AUTO_TEST_SUITE(Net)
+BOOST_FIXTURE_TEST_SUITE(TestDns, DnsFixture)
+
+BOOST_AUTO_TEST_CASE(Asynchronous)
+{
+  SKIP_IF_IP_UNAVAILABLE();
+
+  asyncResolve("nothost.nothost.nothost.arpa",
+               bind(&DnsFixture::onSuccess, this, _1, IpAddress(address_v4()), false, false),
+               bind(&DnsFixture::onFailure, this, true),
+               m_ioService); // should fail
+
+  m_ioService.run();
+  BOOST_CHECK_EQUAL(m_nFailures, 1);
+  BOOST_CHECK_EQUAL(m_nSuccesses, 0);
+}
+
+BOOST_AUTO_TEST_CASE(AsynchronousV4)
+{
+  SKIP_IF_IPV4_UNAVAILABLE();
+
+  asyncResolve("192.0.2.1",
+               bind(&DnsFixture::onSuccess, this, _1,
+                    IpAddress(address_v4::from_string("192.0.2.1")), true, true),
+               bind(&DnsFixture::onFailure, this, false),
+               m_ioService);
+
+  m_ioService.run();
+  BOOST_CHECK_EQUAL(m_nFailures, 0);
+  BOOST_CHECK_EQUAL(m_nSuccesses, 1);
+}
+
+BOOST_AUTO_TEST_CASE(AsynchronousV6)
+{
+  SKIP_IF_IPV6_UNAVAILABLE();
+
+  asyncResolve("ipv6.google.com", // only IPv6 address should be available
+               bind(&DnsFixture::onSuccess, this, _1, IpAddress(address_v6()), true, false),
+               bind(&DnsFixture::onFailure, this, false),
+               m_ioService);
+
+  asyncResolve("2001:db8:3f9:0:3025:ccc5:eeeb:86d3",
+               bind(&DnsFixture::onSuccess, this, _1,
+                    IpAddress(address_v6::from_string("2001:db8:3f9:0:3025:ccc5:eeeb:86d3")),
+                    true, true),
+               bind(&DnsFixture::onFailure, this, false),
+               m_ioService);
+
+  m_ioService.run();
+  BOOST_CHECK_EQUAL(m_nFailures, 0);
+  BOOST_CHECK_EQUAL(m_nSuccesses, 2);
+}
+
+BOOST_AUTO_TEST_CASE(AsynchronousV4AndV6)
+{
+  SKIP_IF_IPV4_UNAVAILABLE();
+  SKIP_IF_IPV6_UNAVAILABLE();
+
+  asyncResolve("www.named-data.net",
+               bind(&DnsFixture::onSuccess, this, _1, IpAddress(address_v4()), true, false),
+               bind(&DnsFixture::onFailure, this, false),
+               m_ioService, Ipv4Only());
+
+  asyncResolve("a.root-servers.net",
+               bind(&DnsFixture::onSuccess, this, _1, IpAddress(address_v4()), true, false),
+               bind(&DnsFixture::onFailure, this, false),
+               m_ioService, Ipv4Only()); // request IPv4 address
+
+  asyncResolve("a.root-servers.net",
+               bind(&DnsFixture::onSuccess, this, _1, IpAddress(address_v6()), true, false),
+               bind(&DnsFixture::onFailure, this, false),
+               m_ioService, Ipv6Only()); // request IPv6 address
+
+  asyncResolve("ipv6.google.com", // only IPv6 address should be available
+               bind(&DnsFixture::onSuccess, this, _1, IpAddress(address_v6()), true, false),
+               bind(&DnsFixture::onFailure, this, false),
+               m_ioService, Ipv6Only());
+
+  asyncResolve("ipv6.google.com", // only IPv6 address should be available
+               bind(&DnsFixture::onSuccess, this, _1, IpAddress(address_v6()), false, false),
+               bind(&DnsFixture::onFailure, this, true),
+               m_ioService, Ipv4Only()); // should fail
+
+  m_ioService.run();
+  BOOST_CHECK_EQUAL(m_nFailures, 1);
+  BOOST_CHECK_EQUAL(m_nSuccesses, 4);
+}
+
+BOOST_AUTO_TEST_CASE(Synchronous)
+{
+  SKIP_IF_IP_UNAVAILABLE();
+
+  IpAddress address = syncResolve("www.named-data.net", m_ioService);
+  BOOST_CHECK(address.is_v4() || address.is_v6());
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestDns
+BOOST_AUTO_TEST_SUITE_END() // Net
+
+} // namespace tests
+} // namespace dns
+} // namespace ndn
diff --git a/tests/unit-tests/util/ethernet.t.cpp b/tests/unit-tests/net/ethernet.t.cpp
similarity index 95%
rename from tests/unit-tests/util/ethernet.t.cpp
rename to tests/unit-tests/net/ethernet.t.cpp
index 38e05aa..cfcd6cb 100644
--- a/tests/unit-tests/util/ethernet.t.cpp
+++ b/tests/unit-tests/net/ethernet.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016 Regents of the University of California,
+ * Copyright (c) 2014-2017 Regents of the University of California,
  *                         Arizona Board of Regents,
  *                         Colorado State University,
  *                         University Pierre & Marie Curie, Sorbonne University,
@@ -25,15 +25,14 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "util/ethernet.hpp"
+#include "net/ethernet.hpp"
 
 #include "boost-test.hpp"
 
 namespace ndn {
-namespace util {
 namespace tests {
 
-BOOST_AUTO_TEST_SUITE(Util)
+BOOST_AUTO_TEST_SUITE(Net)
 BOOST_AUTO_TEST_SUITE(TestEthernet)
 
 BOOST_AUTO_TEST_CASE(Basic)
@@ -112,8 +111,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestEthernet
-BOOST_AUTO_TEST_SUITE_END() // Util
+BOOST_AUTO_TEST_SUITE_END() // Net
 
 } // namespace tests
-} // namespace util
 } // namespace ndn
diff --git a/tests/unit-tests/util/face-uri.t.cpp b/tests/unit-tests/net/face-uri.t.cpp
similarity index 98%
rename from tests/unit-tests/util/face-uri.t.cpp
rename to tests/unit-tests/net/face-uri.t.cpp
index 559a5b0..27313f7 100644
--- a/tests/unit-tests/util/face-uri.t.cpp
+++ b/tests/unit-tests/net/face-uri.t.cpp
@@ -25,19 +25,15 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "util/face-uri.hpp"
-#include "util/ethernet.hpp"
+#include "net/face-uri.hpp"
 
 #include "boost-test.hpp"
-#include "../network-configuration-detector.hpp"
+#include "network-configuration-detector.hpp"
 
 namespace ndn {
-namespace util {
 namespace tests {
 
-using ndn::tests::NetworkConfigurationDetector;
-
-BOOST_AUTO_TEST_SUITE(Util)
+BOOST_AUTO_TEST_SUITE(Net)
 BOOST_AUTO_TEST_SUITE(TestFaceUri)
 
 class CanonizeFixture : noncopyable
@@ -566,8 +562,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestFaceUri
-BOOST_AUTO_TEST_SUITE_END() // Util
+BOOST_AUTO_TEST_SUITE_END() // Net
 
 } // namespace tests
-} // namespace util
 } // namespace ndn
diff --git a/tests/unit-tests/network-configuration-detector.cpp b/tests/unit-tests/net/network-configuration-detector.cpp
similarity index 97%
rename from tests/unit-tests/network-configuration-detector.cpp
rename to tests/unit-tests/net/network-configuration-detector.cpp
index f00b3e8..9aa196b 100644
--- a/tests/unit-tests/network-configuration-detector.cpp
+++ b/tests/unit-tests/net/network-configuration-detector.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
diff --git a/tests/unit-tests/network-configuration-detector.hpp b/tests/unit-tests/net/network-configuration-detector.hpp
similarity index 70%
rename from tests/unit-tests/network-configuration-detector.hpp
rename to tests/unit-tests/net/network-configuration-detector.hpp
index 95d2aa8..c039c52 100644
--- a/tests/unit-tests/network-configuration-detector.hpp
+++ b/tests/unit-tests/net/network-configuration-detector.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2016 Regents of the University of California.
+ * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,12 +19,12 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_TESTS_NETWORK_CONFIGURATION_DETECTOR_HPP
-#define NDN_TESTS_NETWORK_CONFIGURATION_DETECTOR_HPP
+#ifndef NDN_TESTS_NET_NETWORK_CONFIGURATION_DETECTOR_HPP
+#define NDN_TESTS_NET_NETWORK_CONFIGURATION_DETECTOR_HPP
 
 #define SKIP_IF_IPV4_UNAVAILABLE() \
   do { \
-    if (!NetworkConfigurationDetector::hasIpv4()) { \
+    if (!::ndn::tests::NetworkConfigurationDetector::hasIpv4()) { \
       BOOST_WARN_MESSAGE(false, "skipping assertions that require IPv4 support"); \
       return; \
     } \
@@ -32,12 +32,21 @@
 
 #define SKIP_IF_IPV6_UNAVAILABLE() \
   do { \
-    if (!NetworkConfigurationDetector::hasIpv6()) { \
+    if (!::ndn::tests::NetworkConfigurationDetector::hasIpv6()) { \
       BOOST_WARN_MESSAGE(false, "skipping assertions that require IPv6 support"); \
       return; \
     } \
   } while (false)
 
+#define SKIP_IF_IP_UNAVAILABLE() \
+  do { \
+    if (!::ndn::tests::NetworkConfigurationDetector::hasIpv4() && \
+        !::ndn::tests::NetworkConfigurationDetector::hasIpv6()) { \
+      BOOST_WARN_MESSAGE(false, "skipping assertions that require either IPv4 or IPv6 support"); \
+      return; \
+    } \
+  } while (false)
+
 namespace ndn {
 namespace tests {
 
@@ -63,4 +72,4 @@
 } // namespace tests
 } // namespace ndn
 
-#endif // NDN_TESTS_NETWORK_CONFIGURATION_DETECTOR_HPP
+#endif // NDN_TESTS_NET_NETWORK_CONFIGURATION_DETECTOR_HPP
diff --git a/tests/unit-tests/util/network-monitor.t.cpp b/tests/unit-tests/net/network-monitor.t.cpp
similarity index 93%
rename from tests/unit-tests/util/network-monitor.t.cpp
rename to tests/unit-tests/net/network-monitor.t.cpp
index 8e82086..d23cb38 100644
--- a/tests/unit-tests/util/network-monitor.t.cpp
+++ b/tests/unit-tests/net/network-monitor.t.cpp
@@ -19,16 +19,16 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "util/network-monitor.hpp"
+#include "net/network-monitor.hpp"
 
 #include "boost-test.hpp"
 #include <boost/asio/io_service.hpp>
 
 namespace ndn {
-namespace util {
+namespace net {
 namespace tests {
 
-BOOST_AUTO_TEST_SUITE(Util)
+BOOST_AUTO_TEST_SUITE(Net)
 BOOST_AUTO_TEST_SUITE(TestNetworkMonitor)
 
 #define NM_REQUIRE_CAP(capability) \
@@ -66,8 +66,8 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestNetworkMonitor
-BOOST_AUTO_TEST_SUITE_END() // Util
+BOOST_AUTO_TEST_SUITE_END() // Net
 
 } // namespace tests
-} // namespace util
+} // namespace net
 } // namespace ndn
diff --git a/tests/unit-tests/util/dns.t.cpp b/tests/unit-tests/util/dns.t.cpp
deleted file mode 100644
index e76d593..0000000
--- a/tests/unit-tests/util/dns.t.cpp
+++ /dev/null
@@ -1,208 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "util/dns.hpp"
-
-#include "boost-test.hpp"
-#include "../network-configuration-detector.hpp"
-
-#include <boost/asio/io_service.hpp>
-
-namespace ndn {
-namespace util {
-namespace tests {
-
-using boost::asio::ip::address_v4;
-using boost::asio::ip::address_v6;
-
-using ndn::tests::NetworkConfigurationDetector;
-
-class DnsFixture
-{
-public:
-  DnsFixture()
-    : m_nFailures(0)
-    , m_nSuccesses(0)
-  {
-  }
-
-  void
-  onSuccess(const dns::IpAddress& resolvedAddress,
-            const dns::IpAddress& expectedAddress,
-            bool isValid,
-            bool shouldCheckAddress = false)
-  {
-    ++m_nSuccesses;
-
-    if (!isValid) {
-      BOOST_FAIL("Resolved to " + resolvedAddress.to_string() + ", but should have failed");
-    }
-
-    BOOST_CHECK_EQUAL(resolvedAddress.is_v4(), expectedAddress.is_v4());
-
-    // checking address is not deterministic and should be enabled only
-    // if only one IP address will be returned by resolution
-    if (shouldCheckAddress) {
-      BOOST_CHECK_EQUAL(resolvedAddress, expectedAddress);
-    }
-  }
-
-  void
-  onFailure(bool isValid)
-  {
-    ++m_nFailures;
-
-    if (!isValid) {
-      BOOST_FAIL("Resolution should not have failed");
-    }
-
-    BOOST_CHECK_MESSAGE(true, "Resolution failed as expected");
-  }
-
-protected:
-  uint32_t m_nFailures;
-  uint32_t m_nSuccesses;
-  boost::asio::io_service m_ioService;
-};
-
-BOOST_AUTO_TEST_SUITE(Util)
-BOOST_FIXTURE_TEST_SUITE(TestDns, DnsFixture)
-
-BOOST_AUTO_TEST_CASE(Asynchronous)
-{
-  if (!NetworkConfigurationDetector::hasIpv4() && !NetworkConfigurationDetector::hasIpv6()) {
-    BOOST_WARN_MESSAGE(false, "skipping assertions that require either IPv4 or IPv6 support");
-    return;
-  }
-
-  dns::asyncResolve("nothost.nothost.nothost.arpa",
-                    bind(&DnsFixture::onSuccess, this, _1,
-                         dns::IpAddress(address_v4()), false, false),
-                    bind(&DnsFixture::onFailure, this, true),
-                    m_ioService); // should fail
-  m_ioService.run();
-
-  BOOST_CHECK_EQUAL(m_nFailures, 1);
-  BOOST_CHECK_EQUAL(m_nSuccesses, 0);
-}
-
-BOOST_AUTO_TEST_CASE(AsynchronousV4)
-{
-  SKIP_IF_IPV4_UNAVAILABLE();
-
-  dns::asyncResolve("192.0.2.1",
-                    bind(&DnsFixture::onSuccess, this, _1,
-                         dns::IpAddress(address_v4::from_string("192.0.2.1")),
-                         true, true),
-                    bind(&DnsFixture::onFailure, this, false),
-                    m_ioService);
-  m_ioService.run();
-
-  BOOST_CHECK_EQUAL(m_nFailures, 0);
-  BOOST_CHECK_EQUAL(m_nSuccesses, 1);
-}
-
-BOOST_AUTO_TEST_CASE(AsynchronousV6)
-{
-  SKIP_IF_IPV6_UNAVAILABLE();
-
-  dns::asyncResolve("ipv6.google.com", // only IPv6 address should be available
-                    bind(&DnsFixture::onSuccess, this, _1,
-                         dns::IpAddress(address_v6()), true, false),
-                    bind(&DnsFixture::onFailure, this, false),
-                    m_ioService);
-
-  dns::asyncResolve("2001:db8:3f9:0:3025:ccc5:eeeb:86d3",
-                    bind(&DnsFixture::onSuccess, this, _1,
-                         dns::IpAddress(address_v6::
-                                      from_string("2001:db8:3f9:0:3025:ccc5:eeeb:86d3")),
-                         true, true),
-                    bind(&DnsFixture::onFailure, this, false),
-                    m_ioService);
-  m_ioService.run();
-
-  BOOST_CHECK_EQUAL(m_nFailures, 0);
-  BOOST_CHECK_EQUAL(m_nSuccesses, 2);
-}
-
-BOOST_AUTO_TEST_CASE(AsynchronousV4AndV6)
-{
-  SKIP_IF_IPV4_UNAVAILABLE();
-  SKIP_IF_IPV6_UNAVAILABLE();
-
-  dns::asyncResolve("www.named-data.net",
-                    bind(&DnsFixture::onSuccess, this, _1,
-                         dns::IpAddress(address_v4()), true, false),
-                    bind(&DnsFixture::onFailure, this, false),
-                    m_ioService,
-                    dns::Ipv4Only());
-
-  dns::asyncResolve("a.root-servers.net",
-                    bind(&DnsFixture::onSuccess, this, _1,
-                         dns::IpAddress(address_v4()), true, false),
-                    bind(&DnsFixture::onFailure, this, false),
-                    m_ioService,
-                    dns::Ipv4Only()); // request IPv4 address
-
-  dns::asyncResolve("a.root-servers.net",
-                    bind(&DnsFixture::onSuccess, this, _1,
-                         dns::IpAddress(address_v6()), true, false),
-                    bind(&DnsFixture::onFailure, this, false),
-                    m_ioService,
-                    dns::Ipv6Only()); // request IPv6 address
-
-  dns::asyncResolve("ipv6.google.com", // only IPv6 address should be available
-                    bind(&DnsFixture::onSuccess, this, _1,
-                         dns::IpAddress(address_v6()), true, false),
-                    bind(&DnsFixture::onFailure, this, false),
-                    m_ioService,
-                    dns::Ipv6Only());
-
-  dns::asyncResolve("ipv6.google.com", // only IPv6 address should be available
-                    bind(&DnsFixture::onSuccess, this, _1,
-                         dns::IpAddress(address_v6()), false, false),
-                    bind(&DnsFixture::onFailure, this, true), // should fail
-                    m_ioService,
-                    dns::Ipv4Only());
-  m_ioService.run();
-
-  BOOST_CHECK_EQUAL(m_nFailures, 1);
-  BOOST_CHECK_EQUAL(m_nSuccesses, 4);
-}
-
-BOOST_AUTO_TEST_CASE(Synchronous)
-{
-  if (!NetworkConfigurationDetector::hasIpv4() && !NetworkConfigurationDetector::hasIpv6()) {
-    BOOST_WARN_MESSAGE(false, "skipping assertions that require either IPv4 or IPv6 support");
-    return;
-  }
-  dns::IpAddress address;
-  BOOST_CHECK_NO_THROW(address = dns::syncResolve("www.named-data.net", m_ioService));
-
-  BOOST_CHECK(address.is_v4() || address.is_v6());
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestDns
-BOOST_AUTO_TEST_SUITE_END() // Util
-
-} // namespace tests
-} // namespace util
-} // namespace ndn
