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
