finished self-implementation of DNS resolver recursion; will now remove all that!
[pingcheck] / src / dns / dnsmaster.h
index 128633f..63e5be9 100644 (file)
@@ -61,6 +61,23 @@ typedef std::map<resolver_key_type, ResolverItem> resolver_map_type;
 
 std::string to_string(const DnsIpProtocol &protocol);
 
+/**
+ * Factory and Cache of DNS resolvers
+ * 
+ * to avoid having several resolvers resolving the same hostname which might
+ * result in conflicts with caching, this class is a singleton factory and the
+ * only place where Resolvers are constructed. They are remembered in an
+ * internal cache by hostname and IP version requested (v4, v6 or both).
+ * 
+ * During resolving, several different name servers will have to be queried for
+ * the same hostname. These recursive resolvers are created using
+ * get_recursor_for and are NOT cached, so they should only be used from another
+ * "regular" resolver (created using get_resolver_for)
+ *
+ * The DnsMaster also remembers a few global variables that can be queried
+ * using public getter functions and it creates the DnsCache used by all its
+ * resolvers
+ */
 class DnsMaster : boost::noncopyable
 {
 // Resolver factory
@@ -93,7 +110,7 @@ public:
 
 // storage of global variables
 public:
-    //boost::asio::ip::address &get_name_server() const;  // currently unused
+    //boost::asio::ip::address &get_default_name_server() const;  // unused
     int get_resolved_ip_ttl_threshold() const;
     int get_max_address_resolution_attempts() const;