diff --git a/src/clients/query.cpp b/src/clients/query.cpp
new file mode 100644
index 0000000..f890ad1
--- /dev/null
+++ b/src/clients/query.cpp
@@ -0,0 +1,92 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014, 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.
+ *
+ * NDNS is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NDNS 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NDNS, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "query.hpp"
+
+namespace ndn {
+namespace ndns {
+
+Query::Query()
+  : m_interestLifetime(ndn::DEFAULT_INTEREST_LIFETIME)
+{
+}
+
+Query::Query(const Name& hint, const Name& zone, const name::Component& queryType)
+  : m_hint(hint)
+  , m_zone(zone)
+  , m_queryType(queryType)
+  , m_interestLifetime(ndn::DEFAULT_INTEREST_LIFETIME)
+{
+}
+
+
+bool
+Query::fromInterest(const Name& hint, const Name& zone, const Interest& interest)
+{
+  label::MatchResult re;
+  if (!matchName(interest, hint, zone, re))
+    return false;
+
+  m_rrLabel = re.rrLabel;
+  m_rrType = re.rrType;
+
+  m_hint = hint;
+  m_zone = zone;
+
+  size_t len = zone.size();
+  if (!hint.empty())
+    len += hint.size() + 1;
+  m_queryType = interest.getName().get(len);
+
+  return true;
+}
+
+Interest
+Query::toInterest() const
+{
+  // <hint> /xF0. <zone> [<KEY>|<NDNS>|<NDNS-R>] <rrLabel> <rrType>
+  Name name;
+  if (!m_hint.empty()) {
+    name.append(m_hint)
+        .append(ndn::ndns::label::FORWARDING_HINT_LABEL);
+  }
+
+  name.append(this->m_zone)
+      .append(this->m_queryType)
+      .append(this->m_rrLabel)
+      .append(this->m_rrType);
+
+  return Interest(name, m_interestLifetime);
+}
+
+std::ostream&
+operator<<(std::ostream& os, const Query& query)
+{
+  os << "Query: zone=" << query.getZone()
+     << " hint=" << query.getHint()
+     << " queryType=" << query.getQueryType()
+     << " rrLabel=" << query.getRrLabel()
+     << " rrType=" << query.getRrType()
+     << " Lifetime=" << query.getInterestLifetime()
+    ;
+  return os;
+}
+
+} // namespace ndns
+} // namespace ndn
diff --git a/src/clients/query.hpp b/src/clients/query.hpp
new file mode 100644
index 0000000..7b6de33
--- /dev/null
+++ b/src/clients/query.hpp
@@ -0,0 +1,199 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014, 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.
+ *
+ * NDNS is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NDNS 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NDNS, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NDNS_CLIENTS_QUERY_HPP
+#define NDNS_CLIENTS_QUERY_HPP
+
+#include "ndns-label.hpp"
+#include "ndns-enum.hpp"
+
+#include <ndn-cxx/name.hpp>
+
+namespace ndn {
+namespace ndns {
+
+/**
+ * @brief NDNS Query abstraction. Query is an Interest whose name follows the format:
+ * <hint> /xF0. <zone> [<KEY>|<NDNS>|<NDNS-R>] <rrLabel> <rrType>
+ */
+class Query : noncopyable
+{
+public:
+  Query();
+
+  Query(const Name& hint, const Name& zone, const name::Component& queryType);
+
+  /**
+   * @brief construct an Interest according to the query abstraction
+   */
+  Interest
+  toInterest() const;
+
+  /**
+   * @brief extract the query information (rrLabel, rrType) from a Interest
+   * @param[in] interest The Interest to parse; the Interest must have correct hint and zone,
+   *  otherwise it's undefined behavior
+   */
+  bool
+  fromInterest(const Name& hint, const Name& zone, const Interest& interest);
+
+  bool
+  operator==(const Query& other) const
+  {
+    return (getHint() == other.getHint() && getZone() == other.getZone() &&
+      getQueryType() == other.getQueryType() && getRrLabel() == other.getRrLabel() &&
+      getRrType() == other.getRrType());
+  }
+
+  bool
+  operator!=(const Query& other) const
+  {
+    return !(*this == other);
+  }
+
+public:
+
+  /**
+   * @brief get forwarding hint. default empty hint (empty() == True),
+   * hint won't add to the name
+   */
+  const Name&
+  getHint() const
+  {
+    return m_hint;
+  }
+
+  /**
+   * @brief set forwarding hint. default empty hint (empty() == True),
+   * hint won't add to the name
+   */
+  void
+  setHint(const Name& hint)
+  {
+    m_hint = hint;
+  }
+
+
+  /**
+   * @brief get name of authoritative zone
+   */
+  const Name&
+  getZone() const
+  {
+    return m_zone;
+  }
+
+  /**
+   * @brief set name of authoritative zone
+   */
+  void
+  setZone(const Name& zone)
+  {
+    m_zone = zone;
+  }
+
+  /**
+   * @brief get lifetime of the Interest
+   */
+  const time::milliseconds&
+  getInterestLifetime() const
+  {
+    return m_interestLifetime;
+  }
+
+  /**
+   * @brief set lifetime of the Interest
+   */
+  void
+  setInterestLifetime(const time::milliseconds& interestLifetime)
+  {
+    m_interestLifetime = interestLifetime;
+  }
+
+
+  /**
+   * @brief get query type
+   */
+  const name::Component&
+  getQueryType() const
+  {
+    return m_queryType;
+  }
+
+  /**
+   * @brief get query type
+   */
+  void
+  setQueryType(const name::Component& queryType)
+  {
+    m_queryType = queryType;
+  }
+
+  /**
+   * @brief get label of resource record
+   */
+  const Name&
+  getRrLabel() const
+  {
+    return m_rrLabel;
+  }
+
+  /**
+   * @brief set label of resource record
+   */
+  void
+  setRrLabel(const Name& rrLabel)
+  {
+    m_rrLabel = rrLabel;
+  }
+
+  /**
+   * @brief get type resource record
+   */
+  const name::Component&
+  getRrType() const
+  {
+    return m_rrType;
+  }
+
+  /**
+   * @brief set type resource record
+   */
+  void
+  setRrType(const name::Component& rrType)
+  {
+    m_rrType = rrType;
+  }
+
+private:
+  Name m_hint;
+  Name m_zone;
+  name::Component m_queryType;
+  Name m_rrLabel;
+  name::Component m_rrType;
+  time::milliseconds m_interestLifetime;
+};
+
+std::ostream&
+operator<<(std::ostream& os, const Query& query);
+
+} // namespace ndns
+} // namespace ndn
+
+#endif // NDNS_CLIENTS_QUERY_HPP
