diff --git a/src/rrset.cpp b/src/rrset.cpp
new file mode 100644
index 0000000..4559479
--- /dev/null
+++ b/src/rrset.cpp
@@ -0,0 +1,45 @@
+/* -*- 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 "rrset.hpp"
+
+namespace ndn {
+namespace ndns {
+
+Rrset::Rrset(Zone* zone)
+  : m_id(0)
+  , m_zone(zone)
+{
+}
+
+std::ostream&
+operator<<(std::ostream& os, const Rrset& rrset)
+{
+  os << "Rrset: Id=" << rrset.getId();
+  if (rrset.getZone() != 0)
+    os << " Zone=(" << *rrset.getZone() << ")";
+
+  os << " Label=" << rrset.getLabel()
+     << " Type=" << rrset.getType()
+     << " Version=" << rrset.getVersion();
+  return os;
+}
+
+} // namespace ndns
+} // namespace ndn
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
