diff --git a/src/clients/iterative-query-controller.cpp b/src/clients/iterative-query-controller.cpp
index 6bd99bd..899a35c 100644
--- a/src/clients/iterative-query-controller.cpp
+++ b/src/clients/iterative-query-controller.cpp
@@ -63,20 +63,16 @@
 void
 IterativeQueryController::onData(const ndn::Interest& interest, const Data& data)
 {
-  NdnsType ndnsType = NDNS_RAW;
-  const Block* block = data.getMetaInfo().findAppMetaInfo(ndns::tlv::NdnsType);
-  if (block != nullptr) {
-    ndnsType = static_cast<NdnsType>(readNonNegativeInteger(*block));
-  }
+  NdnsContentType contentType = NdnsContentType(data.getContentType());
 
-  NDNS_LOG_TRACE("[* -> *] get a " << ndnsType
+  NDNS_LOG_TRACE("[* -> *] get a " << contentType
                  << " Response: " << data.getName());
   if (m_validator == nullptr) {
-    this->onDataValidated(make_shared<Data>(data), ndnsType);
+    this->onDataValidated(make_shared<Data>(data), contentType);
   }
   else {
     m_validator->validate(data,
-                          bind(&IterativeQueryController::onDataValidated, this, _1, ndnsType),
+                          bind(&IterativeQueryController::onDataValidated, this, _1, contentType),
                           [this] (const shared_ptr<const Data>& data, const std::string& str) {
                             NDNS_LOG_WARN("data: " << data->getName() << " fails verification");
                             this->abort();
@@ -85,22 +81,22 @@
   }
 }
 void
-IterativeQueryController::onDataValidated(const shared_ptr<const Data>& data, NdnsType ndnsType)
+IterativeQueryController::onDataValidated(const shared_ptr<const Data>& data, NdnsContentType contentType)
 {
   switch (m_step) {
   case QUERY_STEP_QUERY_NS:
-    if (ndnsType == NDNS_NACK) {
+    if (contentType == NDNS_NACK) {
       m_step = QUERY_STEP_QUERY_RR;
     }
-    else if (ndnsType == NDNS_RESP) {
-      if (m_rrType == label::NS_RR_TYPE) {
-        Link link(data->wireEncode());
-        if (link.getDelegations().empty()) {
-          m_lastLink = Block();
-        } else {
-          m_lastLink = data->wireEncode();
-        }
+    else if (contentType == NDNS_LINK) {
+      Link link(data->wireEncode());
+      if (link.getDelegations().empty()) {
+        m_lastLink = Block();
+      } else {
+        m_lastLink = data->wireEncode();
       }
+
+      // for NS query, if already received, just return, instead of more queries until NACK
       if (m_nFinishedComps + m_nTryComps == m_dstLabel.size() && m_rrType == label::NS_RR_TYPE) {
         // NS_RR_TYPE is different, since its record is stored at higher level
         m_step = QUERY_STEP_ANSWER_STUB;
@@ -110,13 +106,17 @@
         m_nTryComps = 1;
       }
     }
-    else if (ndnsType == NDNS_AUTH) {
+    else if (contentType == NDNS_AUTH) {
       m_nTryComps += 1;
     }
-    else if (ndnsType == NDNS_RAW) {
+    else if (contentType == NDNS_BLOB) {
       std::ostringstream oss;
       oss << *this;
-      NDNS_LOG_WARN("get unexpected Response: NDNS_RAW for QUERY_NS: " << oss.str());
+      NDNS_LOG_WARN("get unexpected Response: NDNS_BLOB for QUERY_NS: " << oss.str());
+    } else {
+      std::ostringstream oss;
+      oss << *this;
+      NDNS_LOG_WARN("get unexpected Response for QUERY_NS: " << oss.str());
     }
     //
     if (m_nFinishedComps + m_nTryComps > m_dstLabel.size()) {
diff --git a/src/clients/iterative-query-controller.hpp b/src/clients/iterative-query-controller.hpp
index 8fc2a34..7f975da 100644
--- a/src/clients/iterative-query-controller.hpp
+++ b/src/clients/iterative-query-controller.hpp
@@ -78,7 +78,7 @@
   onData(const ndn::Interest& interest, const Data& data);
 
   void
-  onDataValidated(const shared_ptr<const Data>& data, NdnsType ndnsType);
+  onDataValidated(const shared_ptr<const Data>& data, NdnsContentType contentType);
 
   /**
    * @brief change the Controller state according to timeout. For current,
diff --git a/src/clients/response.cpp b/src/clients/response.cpp
index fc14346..0bbc9de 100644
--- a/src/clients/response.cpp
+++ b/src/clients/response.cpp
@@ -24,7 +24,7 @@
 namespace ndns {
 
 Response::Response()
-  : m_ndnsType(NDNS_RAW)
+  : m_contentType(NDNS_BLOB)
   , m_freshnessPeriod(DEFAULT_RR_FRESHNESS_PERIOD)
   , m_appContent(makeBinaryBlock(ndn::tlv::Content, reinterpret_cast<const uint8_t*>(0), 0))
 {
@@ -33,7 +33,7 @@
 Response::Response(const Name& zone, const name::Component& queryType)
   : m_zone(zone)
   , m_queryType(queryType)
-  , m_ndnsType(NDNS_RAW)
+  , m_contentType(NDNS_BLOB)
   , m_freshnessPeriod(DEFAULT_RR_FRESHNESS_PERIOD)
   , m_appContent(makeBinaryBlock(ndn::tlv::Content, reinterpret_cast<const uint8_t*>(0), 0))
 {
@@ -43,7 +43,7 @@
 inline size_t
 Response::wireEncode(EncodingImpl<T>& block) const
 {
-  if (m_ndnsType == NDNS_RAW) {
+  if (m_contentType == NDNS_BLOB) {
     // Raw application content
     return block.prependBlock(m_appContent);
   }
@@ -66,7 +66,7 @@
 const Block
 Response::wireEncode() const
 {
-  if (m_ndnsType == NDNS_RAW) {
+  if (m_contentType == NDNS_BLOB) {
     return m_appContent;
   }
 
@@ -80,7 +80,7 @@
 void
 Response::wireDecode(const Block& wire)
 {
-  if (m_ndnsType == NDNS_RAW) {
+  if (m_contentType == NDNS_BLOB) {
     m_appContent = wire;
     return;
   }
@@ -111,9 +111,7 @@
   MetaInfo info = data.getMetaInfo();
 
   m_freshnessPeriod = time::duration_cast<time::seconds>(info.getFreshnessPeriod());
-  const Block* block = info.findAppMetaInfo(tlv::NdnsType);
-  if (block != 0)
-    m_ndnsType = static_cast<NdnsType>(readNonNegativeInteger(*block));
+  m_contentType = NdnsContentType(data.getContentType());
 
   wireDecode(data.getContent());
   return true;
@@ -139,17 +137,14 @@
 
   shared_ptr<Data> data = make_shared<Data>(name);
 
-  MetaInfo info;
-  info.setFreshnessPeriod(m_freshnessPeriod);
-
-  if (m_ndnsType != NDNS_RAW) {
-    info.addAppMetaInfo(makeNonNegativeIntegerBlock(ndns::tlv::NdnsType, m_ndnsType));
+  if (m_contentType != NDNS_BLOB) {
     data->setContent(this->wireEncode());
   }
   else {
     data->setContent(m_appContent);
   }
-  data->setMetaInfo(info);
+  data->setFreshnessPeriod(m_freshnessPeriod);
+  data->setContentType(m_contentType);
 
   return data;
 }
@@ -198,12 +193,12 @@
   bool tmp = (getZone() == other.getZone() &&
               getQueryType() == other.getQueryType() && getRrLabel() == other.getRrLabel() &&
               getRrType() == other.getRrType() && getVersion() == other.getVersion() &&
-              getNdnsType() == other.getNdnsType());
+              getContentType() == other.getContentType());
 
   if (tmp == false)
     return tmp;
 
-  if (m_ndnsType == NDNS_RAW) {
+  if (m_contentType == NDNS_BLOB) {
     return tmp && (getAppContent() == other.getAppContent());
   }
   else
@@ -219,8 +214,8 @@
      << " rrType=" << response.getRrType()
      << " version=" << response.getVersion()
      << " freshnessPeriod=" << response.getFreshnessPeriod()
-     << " ndnsType=" << response.getNdnsType();
-  if (response.getNdnsType() == NDNS_RAW) {
+     << " NdnsContentType=" << response.getContentType();
+  if (response.getContentType() == NDNS_BLOB) {
     if (response.getAppContent().empty())
       os << " appContent=NULL";
     else
diff --git a/src/clients/response.hpp b/src/clients/response.hpp
index c6a2779..9f2138f 100644
--- a/src/clients/response.hpp
+++ b/src/clients/response.hpp
@@ -177,15 +177,15 @@
   }
 
   void
-  setNdnsType(NdnsType ndnsType)
+  setContentType(NdnsContentType contentType)
   {
-    m_ndnsType = ndnsType;
+    m_contentType = contentType;
   }
 
-  NdnsType
-  getNdnsType() const
+  NdnsContentType
+  getContentType() const
   {
-    return m_ndnsType;
+    return m_contentType;
   }
 
   const Block&
@@ -228,7 +228,7 @@
   name::Component m_rrType;
   name::Component m_version;
 
-  NdnsType m_ndnsType;
+  NdnsContentType m_contentType;
   time::seconds m_freshnessPeriod;
 
   /**
diff --git a/src/daemon/name-server.cpp b/src/daemon/name-server.cpp
index ab3356c..70288ec 100644
--- a/src/daemon/name-server.cpp
+++ b/src/daemon/name-server.cpp
@@ -103,14 +103,11 @@
   }
   else {
     // no record, construct NACK
-    Block block = makeNonNegativeIntegerBlock(tlv::NdnsType, NDNS_NACK);
-    MetaInfo info;
-    info.addAppMetaInfo(block);
-    info.setFreshnessPeriod(this->getContentFreshness());
     Name name = interest.getName();
     name.appendVersion();
     shared_ptr<Data> answer = make_shared<Data>(name);
-    answer->setMetaInfo(info);
+    answer->setFreshnessPeriod(this->getContentFreshness());
+    answer->setContentType(NDNS_NACK);
 
     m_keyChain.sign(*answer, m_certName);
     NDNS_LOG_TRACE("answer query with NDNS-NACK: " << answer->getName());
@@ -168,14 +165,11 @@
   rrset.setLabel(re.rrLabel);
   rrset.setType(re.rrType);
 
-  Block ndnsType = makeNonNegativeIntegerBlock(::ndn::ndns::tlv::NdnsType, NDNS_RESP);
-  MetaInfo info;
-  info.addAppMetaInfo(ndnsType);
-  info.setFreshnessPeriod(this->getContentFreshness());
   Name name = interest->getName();
   name.appendVersion();
   shared_ptr<Data> answer = make_shared<Data>(name);
-  answer->setMetaInfo(info);
+  answer->setFreshnessPeriod(this->getContentFreshness());
+  answer->setContentType(NDNS_RESP);
 
   Block blk(ndn::ndns::tlv::RrData);
   try {
diff --git a/src/daemon/rrset-factory.cpp b/src/daemon/rrset-factory.cpp
index b1bbf90..a75c650 100644
--- a/src/daemon/rrset-factory.cpp
+++ b/src/daemon/rrset-factory.cpp
@@ -153,7 +153,7 @@
     link.addDelegation(i.first, i.second);
   }
 
-  setMetaInfo(link);
+  setContentType(link, NDNS_LINK, ttl);
   sign(link);
   rrset.setData(link.wireEncode());
 
@@ -188,7 +188,7 @@
   Data data(name);
   data.setContent(wireEncode(rrs));
 
-  setMetaInfo(data);
+  setContentType(data, NDNS_RESP, ttl);
   sign(data);
   rrset.setData(data.wireEncode());
 
@@ -216,7 +216,7 @@
   Data data(name);
   data.setContent(cert.wireEncode());
 
-  setMetaInfo(data);
+  setContentType(data, NDNS_BLOB, ttl);
   sign(data);
   rrset.setData(data.wireEncode());
 
@@ -231,12 +231,11 @@
 }
 
 void
-RrsetFactory::setMetaInfo(Data& data)
+RrsetFactory::setContentType(Data& data, NdnsContentType contentType,
+                             const time::seconds& ttl)
 {
-  MetaInfo metaInfo = data.getMetaInfo();
-  metaInfo.addAppMetaInfo(makeNonNegativeIntegerBlock(ndns::tlv::NdnsType,
-                                                      NDNS_RESP));
-  data.setMetaInfo(metaInfo);
+  data.setContentType(contentType);
+  data.setFreshnessPeriod(ttl);
 }
 
 template<encoding::Tag TAG>
@@ -273,7 +272,7 @@
   std::vector<std::string> txts;
   wire.parse();
 
-  for (const auto& e: wire.elements()) {
+  for (const auto& e : wire.elements()) {
     txts.push_back(std::string(reinterpret_cast<const char*>(e.value()),
                                e.value_size()));
   }
diff --git a/src/daemon/rrset-factory.hpp b/src/daemon/rrset-factory.hpp
index 732f0a7..8318bb8 100644
--- a/src/daemon/rrset-factory.hpp
+++ b/src/daemon/rrset-factory.hpp
@@ -24,6 +24,7 @@
 #include "rrset.hpp"
 #include "logger.hpp"
 #include "daemon/db-mgr.hpp"
+#include "ndns-enum.hpp"
 
 #include <ndn-cxx/link.hpp>
 #include <ndn-cxx/security/key-chain.hpp>
@@ -106,8 +107,8 @@
   void
   sign(Data& data);
 
-  void
-  setMetaInfo(Data& data);
+  void setContentType(Data& data, NdnsContentType contentType,
+                      const time::seconds& ttl);
 
 private:
   KeyChain& m_keyChain;
diff --git a/src/mgmt/management-tool.cpp b/src/mgmt/management-tool.cpp
index dc3f971..0ddf57b 100644
--- a/src/mgmt/management-tool.cpp
+++ b/src/mgmt/management-tool.cpp
@@ -345,11 +345,11 @@
     Data data(rrset.getData());
     Response re;
     re.fromData(zoneName, data);
-    int iteration = re.getNdnsType() == NDNS_RAW || re.getNdnsType() == NDNS_AUTH ?
+    int iteration = re.getContentType() == NDNS_BLOB || re.getContentType() == NDNS_AUTH ?
                       1 : re.getRrs().size();
     const std::vector<Block> &rrs = re.getRrs();
 
-    if (re.getNdnsType() != NDNS_RAW) {
+    if (re.getContentType() != NDNS_BLOB) {
       os << "; rrset=" << rrset.getLabel().toUri()
          << " type=" << rrset.getType().toUri()
          << " version=" << rrset.getVersion().toUri()
@@ -368,7 +368,7 @@
       os.width(typeWidth + 2);
       os << rrset.getType().toUri();
 
-      if (re.getNdnsType() != NDNS_RAW) {
+      if (re.getContentType() != NDNS_BLOB) {
         using namespace CryptoPP;
         if (rrset.getType() == label::TXT_RR_TYPE) {
           os.write(reinterpret_cast<const char*>(rrs[i].value()), rrs[i].value_size());
@@ -376,7 +376,7 @@
         }
         else if (rrset.getType() == label::NS_RR_TYPE) {
           BOOST_ASSERT(iteration == 1);
-          if (re.getNdnsType() == NDNS_AUTH) {
+          if (re.getContentType() == NDNS_AUTH) {
             const std::string authStr = "NDNS-Auth";
             os << authStr;
           } else {
@@ -397,14 +397,14 @@
       }
     }
 
-    if (re.getNdnsType() == NDNS_RAW) {
+    if (re.getContentType() == NDNS_BLOB) {
       os.width();
-      os << "; content-type=" << re.getNdnsType()
+      os << "; content-type=" << re.getContentType()
          << " version=" << rrset.getVersion().toUri()
          << " signed-by=" << data.getSignature().getKeyLocator().getName().toUri();
       os << std::endl;
 
-      if (printRaw && re.getNdnsType() == NDNS_RAW) {
+      if (printRaw && re.getContentType() == NDNS_BLOB) {
         util::IndentedStream istream(os, "; ");
 
         if (re.getRrType() == label::CERT_RR_TYPE) {
diff --git a/src/ndns-enum.cpp b/src/ndns-enum.cpp
index 45504fb..383eb95 100644
--- a/src/ndns-enum.cpp
+++ b/src/ndns-enum.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2016, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -23,20 +23,26 @@
 namespace ndns {
 
 std::ostream&
-operator<<(std::ostream& os, const NdnsType ndnsType)
+operator<<(std::ostream& os, const NdnsContentType ndnsType)
 {
   switch (ndnsType) {
-  case NDNS_RESP:
-    os << "NDNS-Resp";
+  case NDNS_BLOB:
+    os << "BLOB";
+    break;
+  case NDNS_LINK:
+    os << "LINK";
     break;
   case NDNS_NACK:
-    os << "NDNS-Nack";
+    os << "NACK";
+    break;
+  case NDNS_KEY:
+    os << "KEY";
     break;
   case NDNS_AUTH:
     os << "NDNS-Auth";
     break;
-  case NDNS_RAW:
-    os << "NDNS-Raw";
+  case NDNS_RESP:
+    os << "NDNS-Resp";
     break;
   default:
     os << "UNKNOWN";
diff --git a/src/ndns-enum.hpp b/src/ndns-enum.hpp
index 39e77b0..89ad87d 100644
--- a/src/ndns-enum.hpp
+++ b/src/ndns-enum.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2016, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -21,24 +21,26 @@
 #define NDNS_NDNS_ENUM_HPP
 
 #include <ostream>
+#include <ndn-cxx/encoding/tlv.hpp>
 
 namespace ndn {
 namespace ndns {
 
 /**
- * @brief NdnsType defined in Response.NdnsMetaInfo.NdnsType
+ * @brief contentType of response
  */
-enum NdnsType {
-  NDNS_RAW = 0, ///< this is not a real type, just mean that MetaInfo does not contain NdnsType
-  NDNS_RESP = 1, ///< response type means there are requested RR
-  NDNS_NACK = 2, ///< no requested RR
-  NDNS_AUTH = 3, ///< only has RR for detailed (longer) label
-
-  NDNS_UNKNOWN = 255
+enum NdnsContentType {
+  NDNS_BLOB = ndn::tlv::ContentType_Blob,
+  NDNS_LINK = ndn::tlv::ContentType_Link,
+  NDNS_KEY  = ndn::tlv::ContentType_Key,
+  NDNS_NACK = ndn::tlv::ContentType_Nack,
+  NDNS_AUTH = 1086, ///< only has RR for detailed (longer) label
+  NDNS_RESP = 1087, ///< response type means there are requested RR
+  NDNS_UNKNOWN = 1088,  ///< this is not a real type, just mean that contentType is unknown
 };
 
 std::ostream&
-operator<<(std::ostream& os, const NdnsType ndnsType);
+operator<<(std::ostream& os, const NdnsContentType contentType);
 
 /**
  * @brief define Return code of Update's Response
diff --git a/src/ndns-tlv.hpp b/src/ndns-tlv.hpp
index 3f8399d..27235a3 100644
--- a/src/ndns-tlv.hpp
+++ b/src/ndns-tlv.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2016, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -30,7 +30,6 @@
  * @brief the field defined in NDNS packet format
  */
 enum {
-  NdnsType = 180, ///< Detailed Types are defined in NdnsType in ndns-enum.hpp
   Rr = 190,
   RrData = 191,
 
diff --git a/src/util/util.cpp b/src/util/util.cpp
index 1b14896..31f3549 100644
--- a/src/util/util.cpp
+++ b/src/util/util.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2016, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -23,8 +23,8 @@
 namespace ndn {
 namespace ndns {
 
-NdnsType
-toNdnsType(const std::string& str)
+NdnsContentType
+toNdnsContentType(const std::string& str)
 {
   if (str == "resp")
     return NDNS_RESP;
@@ -32,8 +32,10 @@
     return NDNS_NACK;
   else if (str == "auth")
     return NDNS_AUTH;
-  else if (str == "raw")
-    return NDNS_RAW;
+  else if (str == "blob")
+    return NDNS_BLOB;
+  else if (str == "link")
+    return NDNS_LINK;
   else
     return NDNS_UNKNOWN;
 }
diff --git a/src/util/util.hpp b/src/util/util.hpp
index 7acf496..24aa179 100644
--- a/src/util/util.hpp
+++ b/src/util/util.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2016, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -26,8 +26,8 @@
 namespace ndn {
 namespace ndns {
 
-NdnsType
-toNdnsType(const std::string& str);
+NdnsContentType
+toNdnsContentType(const std::string& str);
 
 /**
  * @brief print the data in a flexible way
diff --git a/tests/unit/clients/iterative-query-controller.cpp b/tests/unit/clients/iterative-query-controller.cpp
index 308683e..453e743 100644
--- a/tests/unit/clients/iterative-query-controller.cpp
+++ b/tests/unit/clients/iterative-query-controller.cpp
@@ -76,8 +76,6 @@
 
 BOOST_AUTO_TEST_SUITE(IterativeQueryController)
 
-BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(Basic, 3)
-
 BOOST_FIXTURE_TEST_CASE(Basic, QueryControllerFixture)
 {
   using std::string;
diff --git a/tests/unit/clients/response.cpp b/tests/unit/clients/response.cpp
index c575c85..5c41f7d 100644
--- a/tests/unit/clients/response.cpp
+++ b/tests/unit/clients/response.cpp
@@ -36,12 +36,12 @@
   ndns::Response r(zone, qType);
   r.setRrLabel(Name("/ndnsim/www"));
   r.setRrType(label::CERT_RR_TYPE);
-  r.setNdnsType(NDNS_RAW);
+  r.setContentType(NDNS_BLOB);
   r.setFreshnessPeriod(time::seconds(4000));
 
   BOOST_CHECK_EQUAL(r.getFreshnessPeriod(), time::seconds(4000));
   BOOST_CHECK_EQUAL(r.getRrType(), label::CERT_RR_TYPE);
-  BOOST_CHECK_EQUAL(r.getNdnsType(), NDNS_RAW);
+  BOOST_CHECK_EQUAL(r.getContentType(), NDNS_BLOB);
   BOOST_CHECK_EQUAL(r.getZone(), zone);
   BOOST_CHECK_EQUAL(r.getQueryType(), qType);
 
@@ -59,7 +59,7 @@
   ndns::Response r4(zone, qType);
   r4.setRrLabel(Name("/ndnsim/www"));
   r4.setRrType(label::TXT_RR_TYPE);
-  r4.setNdnsType(NDNS_RESP);
+  r4.setContentType(NDNS_RESP);
 
   std::string str = "Just try it";
   Block s = makeBinaryBlock(ndns::tlv::RrData, str.c_str(), str.size());
diff --git a/tests/unit/daemon/name-server.cpp b/tests/unit/daemon/name-server.cpp
index 64d0429..4b6af12 100644
--- a/tests/unit/daemon/name-server.cpp
+++ b/tests/unit/daemon/name-server.cpp
@@ -75,7 +75,7 @@
 
     Response resp;
     BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-    BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RESP);
+    BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_LINK);
   });
 
   face.receive(q.toInterest());
@@ -103,13 +103,13 @@
 
     Response resp;
     BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-    BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_NACK);
+    BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_NACK);
   });
 
   face.receive(q.toInterest());
   run();
 
-  // will ask for the existing record (will have type NDNS_RAW, as it is certificate)
+  // will ask for the existing record (will have type NDNS_BLOB, as it is certificate)
   face.onSendData.connectSingleShot([&] (const Data& data) {
     ++nDataBack;
     NDNS_LOG_TRACE("get Data back");
@@ -117,7 +117,7 @@
 
     Response resp;
     BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-    BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RAW);
+    BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_BLOB);
   });
 
   q.setRrLabel("dsk-1");
@@ -135,7 +135,7 @@
 
     Response resp;
     BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-    BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RAW);
+    BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_BLOB);
   });
 
   run();
@@ -149,7 +149,7 @@
 
     Response resp;
     BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-    BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_NACK);
+    BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_NACK);
   });
 
   run();
@@ -163,7 +163,7 @@
   re.setQueryType(label::NDNS_ITERATIVE_QUERY);
   re.setRrLabel(Name("net"));
   re.setRrType(label::NS_RR_TYPE);
-  re.setNdnsType(NDNS_RESP);
+  re.setContentType(NDNS_RESP);
 
   std::string str = "ns1.ndnsim.net";
   re.addRr(makeBinaryBlock(ndns::tlv::RrData, str.c_str(), str.size()));
@@ -190,7 +190,7 @@
     Response resp;
 
     BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-    BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RESP); // by default NDNS_RAW is enough
+    BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_RESP); // by default NDNS_BLOB is enough
     BOOST_CHECK_GT(resp.getRrs().size(), 0);
     Block block = resp.getRrs()[0];
     block.parse();
@@ -215,7 +215,7 @@
   re.setQueryType(label::NDNS_ITERATIVE_QUERY);
   re.setRrLabel(Name("net-XYZ")); // insert new records
   re.setRrType(label::NS_RR_TYPE);
-  re.setNdnsType(NDNS_RESP);
+  re.setContentType(NDNS_RESP);
 
   std::string str = "ns1.ndnsim.net";
   re.addRr(makeBinaryBlock(ndns::tlv::RrData, str.c_str(), str.size()));
@@ -242,7 +242,7 @@
     Response resp;
 
     BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-    BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RESP); // by default NDNS_RAW is enough
+    BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_RESP); // by default NDNS_BLOB is enough
     BOOST_CHECK_GT(resp.getRrs().size(), 0);
     Block block = resp.getRrs()[0];
     block.parse();
@@ -291,7 +291,7 @@
   re.setQueryType(label::NDNS_ITERATIVE_QUERY);
   re.setRrLabel(Name("ndnsim-XYZ")); // insert new records
   re.setRrType(label::NS_RR_TYPE);
-  re.setNdnsType(NDNS_RESP);
+  re.setContentType(NDNS_RESP);
 
   std::string str = "ns1.ndnsim.net";
   re.addRr(makeBinaryBlock(ndns::tlv::RrData, str.c_str(), str.size()));
@@ -393,7 +393,7 @@
   re.setQueryType(label::NDNS_ITERATIVE_QUERY);
   re.setRrLabel(Name("ndnsim-XYZ")); // insert new records
   re.setRrType(label::NS_RR_TYPE);
-  re.setNdnsType(NDNS_RESP);
+  re.setContentType(NDNS_RESP);
 
   std::string str = "ns1.ndnsim.net";
   re.addRr(makeBinaryBlock(ndns::tlv::RrData, str.c_str(), str.size()));
@@ -429,7 +429,7 @@
       Response resp;
 
       BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-      BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RESP); // by default NDNS_RAW is enough
+      BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_RESP); // by default NDNS_BLOB is enough
       BOOST_CHECK_GT(resp.getRrs().size(), 0);
       Block block = resp.getRrs()[0];
       block.parse();
diff --git a/tests/unit/database-test-data.cpp b/tests/unit/database-test-data.cpp
index 6edcd1c..4b1de42 100644
--- a/tests/unit/database-test-data.cpp
+++ b/tests/unit/database-test-data.cpp
@@ -78,17 +78,20 @@
     const time::seconds ttl(3000 + 100 * certificateIndex);
     const name::Component version = name::Component::fromVersion(100 + 1000 * certificateIndex);
     name::Component qType(label::NDNS_ITERATIVE_QUERY);
-    NdnsType ndnsType = NDNS_RESP;
+    NdnsContentType contentType = NDNS_RESP;
     if (type == label::CERT_RR_TYPE) {
-      ndnsType = NDNS_RAW;
+      contentType = NDNS_BLOB;
       qType = label::NDNS_CERT_QUERY;
+    } else if (type == label::NS_RR_TYPE) {
+      contentType = NDNS_LINK;
+    } else if (type == label::TXT_RR_TYPE) {
+      contentType = NDNS_RESP;
     }
     std::ostringstream os;
     os << "a fake content: " << (++certificateIndex) << "th";
 
-    addRrset(zone, label, type, ttl, version, qType, ndnsType, os.str());
+    addRrset(zone, label, type, ttl, version, qType, contentType, os.str());
   };
-
   addQueryRrset("/dsk-1", m_root, label::CERT_RR_TYPE);
   addQueryRrset("/net/ksk-2", m_root, label::CERT_RR_TYPE);
   addQueryRrset("/dsk-3", m_net, label::CERT_RR_TYPE);
@@ -114,7 +117,7 @@
 void
 DbTestData::addRrset(Zone& zone, const Name& label, const name::Component& type,
                      const time::seconds& ttl, const name::Component& version,
-                     const name::Component& qType, NdnsType ndnsType, const std::string& msg)
+                     const name::Component& qType, NdnsContentType contentType, const std::string& msg)
 {
   Rrset rrset;
   RrsetFactory rf(TEST_DATABASE.string(), zone.getName(),
@@ -123,7 +126,7 @@
   if (type == label::NS_RR_TYPE) {
     ndn::Link::DelegationSet ds = {std::pair<uint32_t, Name>(1,"/xx")};
     rrset = rf.generateNsRrset(label, type, version.toVersion(), ttl, ds);
-    if (ndnsType != NDNS_AUTH) {
+    if (contentType != NDNS_AUTH) {
       // do not add AUTH packet to link
       m_links.push_back(Link(rrset.getData()));
     }
diff --git a/tests/unit/database-test-data.hpp b/tests/unit/database-test-data.hpp
index 26e092f..82410fe 100644
--- a/tests/unit/database-test-data.hpp
+++ b/tests/unit/database-test-data.hpp
@@ -46,7 +46,7 @@
   void
   addRrset(Zone& zone, const Name& label, const name::Component& type,
            const time::seconds& ttl, const name::Component& version,
-           const name::Component& qType, NdnsType ndnsType, const std::string& msg);
+           const name::Component& qType, NdnsContentType contentType, const std::string& msg);
 public:
   class PreviousStateCleaner
   {
diff --git a/tools/ndns-dig.cpp b/tools/ndns-dig.cpp
index f7f9af0..0497315 100644
--- a/tools/ndns-dig.cpp
+++ b/tools/ndns-dig.cpp
@@ -105,7 +105,7 @@
     Name name = Name().append(response.getZone()).append(response.getRrLabel());
     if (name == m_dstLabel && m_rrType == response.getRrType()) {
       NDNS_LOG_INFO("This is the final response returned by zone=" << response.getZone()
-                    << " and NdnsType=" << response.getNdnsType()
+                    << " and NdnsType=" << response.getContentType()
                     << ". It contains " << response.getRrs().size() << " RR(s)");
 
       std::string msg;
diff --git a/tools/ndns-update.cpp b/tools/ndns-update.cpp
index 9dbbb2c..0652677 100644
--- a/tools/ndns-update.cpp
+++ b/tools/ndns-update.cpp
@@ -209,7 +209,7 @@
   int ttl = 4;
   Name rrLabel;
   string rrType = "TXT";
-  string ndnsTypeStr = "resp";
+  string contentTypeStr = "resp";
   Name certName;
   std::vector<string> contents;
   string contentFile;
@@ -226,8 +226,8 @@
     config.add_options()
       ("ttl,T", po::value<int>(&ttl), "TTL of query. default: 4 sec")
       ("rrtype,t", po::value<string>(&rrType), "set request RR Type. default: TXT")
-      ("ndnsType,n", po::value<string>(&ndnsTypeStr), "Set the ndnsType of the resource record. "
-       "Potential values are [resp|nack|auth|raw]. Default: resp")
+      ("contentType,n", po::value<string>(&contentTypeStr), "Set the contentType of the resource record. "
+       "Potential values are [blob|link|nack|auth|resp]. Default: resp")
       ("cert,c", po::value<Name>(&certName), "set the name of certificate to sign the update")
       ("content,o", po::value<std::vector<string>>(&contents)->multitoken(),
        "set the content of the RR")
@@ -251,7 +251,7 @@
     config_file_options.add(config).add(hidden);
 
     po::options_description visible("Usage: ndns-update zone rrLabel [-t rrType] [-T TTL] "
-                                    "[-n NdnsType] [-c cert] "
+                                    "[-n NdnsContentType] [-c cert] "
                                     "[-f contentFile]|[-o content]\n"
                                     "Allowed options");
 
@@ -313,10 +313,10 @@
         }
       }
 
-      NdnsType ndnsType = toNdnsType(ndnsTypeStr);
+      NdnsContentType contentType = toNdnsContentType(contentTypeStr);
 
-      if (ndnsType == ndns::NDNS_UNKNOWN) {
-        std::cerr << "unknown NdnsType: " << ndnsTypeStr << std::endl;
+      if (contentType == ndns::NDNS_UNKNOWN) {
+        std::cerr << "unknown NdnsContentType: " << contentTypeStr << std::endl;
         return 1;
       }
 
@@ -328,7 +328,7 @@
 
       re.setQueryType(qType);
       re.setRrType(name::Component(rrType));
-      re.setNdnsType(ndnsType);
+      re.setContentType(contentType);
 
       for (const auto& content : contents) {
         re.addRr(makeBinaryBlock(ndns::tlv::RrData, content.c_str(), content.size()));
