diff --git a/src/rrset.hpp b/src/rrset.hpp
new file mode 100644
index 0000000..69b311b
--- /dev/null
+++ b/src/rrset.hpp
@@ -0,0 +1,210 @@
+/* -*- 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_RRSET_HPP
+#define NDNS_RRSET_HPP
+
+#include "zone.hpp"
+
+namespace ndn {
+namespace ndns {
+
+/**
+ * @brief Resource Record Set (rrset) define the the entry's attributes in NDNS
+ *        this class also reflects the table (rrset) schema in the database
+ *
+ * The class is copyable, since it may be assigned to another Rrset instance
+ * when resolving Response or Query from database
+ */
+class Rrset
+{
+public:
+  explicit
+  Rrset(Zone* zone = 0);
+
+  /**
+   * @brief get the id
+   *
+   * Default value is 0, the database has to guarantee that id is greater than 0.
+   */
+  uint64_t
+  getId() const
+  {
+    return m_id;
+  }
+
+  /**
+   * @brief set the id
+   *
+   * Default value is 0, the database has to guarantee that id is greater than 0.
+   */
+  void
+  setId(uint64_t id)
+  {
+    m_id = id;
+  }
+
+  /**
+   * @brief get the zone where the record is stored
+   */
+  Zone*
+  getZone() const
+  {
+    return m_zone;
+  }
+
+  /**
+   * @brief set the zone where the record is stored
+   */
+  void
+  setZone(Zone* zone)
+  {
+    m_zone = zone;
+  }
+
+  /**
+   * @brief get the label of rrset
+   */
+  const Name&
+  getLabel() const
+  {
+    return m_label;
+  }
+
+  /**
+   * @brief set the label of rrset
+   */
+  void
+  setLabel(const Name& label)
+  {
+    m_label = label;
+  }
+
+  /**
+   * @brief get the type of this rrset
+   */
+  const name::Component&
+  getType() const
+  {
+    return m_type;
+  }
+
+  /**
+   * @brief set the type of this rrset
+   */
+  void
+  setType(const name::Component& type)
+  {
+    m_type = type;
+  }
+
+  /**
+   * @brief get version of the data
+   */
+  const name::Component&
+  getVersion() const
+  {
+    return m_version;
+  }
+
+  /**
+   * @brief set version of the rrset
+   */
+  void
+  setVersion(const name::Component& version)
+  {
+    m_version = version;
+  }
+
+  /**
+   * @brief get ttl of the rrset
+   */
+  const time::seconds&
+  getTtl() const
+  {
+    return m_ttl;
+  }
+
+  /**
+   * @brief set ttl of the rrset
+   */
+  void
+  setTtl(const time::seconds& ttl)
+  {
+    m_ttl = ttl;
+  }
+
+  /**
+   * @brief get wire formatted block of the Response
+   */
+  const Block&
+  getData() const
+  {
+    return m_data;
+  }
+
+  /**
+   * @brief set wire formatted block of the Response
+   */
+  void
+  setData(const Block& data)
+  {
+    m_data = data;
+  }
+
+  /**
+   * @brief compare two rrset instance
+   *
+   * Note that comparison ignores id, TTL, and Data when comparing RR sets
+   */
+  bool
+  operator==(const Rrset& other) const
+  {
+    return (getZone() == other.getZone() && getLabel() == other.getLabel() &&
+            getType() == other.getType() && getVersion() == other.getVersion());
+  }
+
+  /**
+   * @brief compare two rrset instance
+   *
+   * Note that comparison ignores id, TTL, and Data when comparing RR sets
+   */
+  bool
+  operator!=(const Rrset& other) const
+  {
+    return !(*this == other);
+  }
+
+private:
+  uint64_t m_id;
+  Zone* m_zone;
+  Name m_label;
+  name::Component m_type;
+  name::Component m_version;
+  time::seconds m_ttl;
+  Block m_data;
+};
+
+std::ostream&
+operator<<(std::ostream& os, const Rrset& Rrset);
+
+} // namespace ndns
+} // namespace ndn
+
+#endif // NDNS_RRSET_HPP
